elflink: Allocate space for 'realname'
authorMatt Fleming <matt.fleming@intel.com>
Tue, 3 Apr 2012 15:17:17 +0000 (16:17 +0100)
committerMatt Fleming <matt.fleming@intel.com>
Tue, 17 Apr 2012 10:23:41 +0000 (11:23 +0100)
search_dirs() expects the 'realname' argument to point to space
allocated for storing the real path name. Currently we're passing an
uninitialized pointer which was highlighted by the following build
warning,

elflink/load_env32.c:155:18: warning: ‘realname’ may be used uninitialized in this function

Signed-off-by: Matt Fleming <matt.fleming@intel.com>
core/elflink/load_env32.c

index 51929c8..566035b 100644 (file)
@@ -109,7 +109,7 @@ void load_env32(com32sys_t * regs)
        struct file_info *fp;
        int fd;
        char *argv[] = { LDLINUX, NULL };
-       char *realname;
+       char realname[FILENAME_MAX];
 
        static const char *search_directories[] = {
                "/boot/isolinux",