In common/cmd_nvedit.c, en env_print(), the wrong type is used for len.
hexport_r() returns -1 on error (like OOM), which is converted to
0xffffffff when put in an unsigned. Said value is obviously bigger then
0, and as a result an uninitialized string is then displayed. Other
usages of hexport_r() in the code correctly uses ssize_t to keep its
return value.
Signed-off-by: Maxime Larocque <maxmtl2002@yahoo.ca>
static int env_print(char *name, int flag)
{
char *res = NULL;
- size_t len;
+ ssize_t len;
if (name) { /* print a single name */
ENTRY e, *ep;
}
/* should never happen */
+ printf("## Error: cannot export environment\n");
return 0;
}