[syslinux:elflink] elflink: Allocate space for 'realname'

syslinux-bot for Matt Fleming matt.fleming at intel.com
Tue Apr 17 11:24:20 PDT 2012


Commit-ID:  816f3fc95a0098c435c314735e3b1d96729e8e7e
Gitweb:     http://www.syslinux.org/commit/816f3fc95a0098c435c314735e3b1d96729e8e7e
Author:     Matt Fleming <matt.fleming at intel.com>
AuthorDate: Tue, 3 Apr 2012 16:17:17 +0100
Committer:  Matt Fleming <matt.fleming at intel.com>
CommitDate: Tue, 17 Apr 2012 11:23:41 +0100

elflink: Allocate space for 'realname'

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 at intel.com>

---
 core/elflink/load_env32.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/core/elflink/load_env32.c b/core/elflink/load_env32.c
index 51929c8..566035b 100644
--- a/core/elflink/load_env32.c
+++ b/core/elflink/load_env32.c
@@ -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",


More information about the Syslinux-commits mailing list