[syslinux:master] extlinux: Avoid dereferencing a garbage pointer
syslinux-bot for Matt Fleming
matt.fleming at intel.com
Sat Feb 16 02:00:02 PST 2013
Commit-ID: 2a7fdfe43f7b9fc6360fe67b023f17ebb23a996c
Gitweb: http://www.syslinux.org/commit/2a7fdfe43f7b9fc6360fe67b023f17ebb23a996c
Author: Matt Fleming <matt.fleming at intel.com>
AuthorDate: Fri, 2 Nov 2012 17:02:36 +0000
Committer: Matt Fleming <matt.fleming at intel.com>
CommitDate: Mon, 5 Nov 2012 08:59:24 +0000
extlinux: Avoid dereferencing a garbage pointer
If opt.reset_adv is set the call to ext_read_adv() is skipped which
would have initialised 'filename'. This means that a pointer
containing random data from the stack is passed to ext_write_adv().
Just delete the opt.reset_adv logic since modify_adv() handles that
case anyway.
Reported-by: Frediano Ziglio <frediano.ziglio at citrix.com>
Signed-off-by: Matt Fleming <matt.fleming at intel.com>
---
extlinux/main.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/extlinux/main.c b/extlinux/main.c
index f0d8e11..dbf538a 100644
--- a/extlinux/main.c
+++ b/extlinux/main.c
@@ -1236,9 +1236,7 @@ int modify_existing_adv(const char *path)
if (devfd < 0)
return 1;
- if (opt.reset_adv)
- syslinux_reset_adv(syslinux_adv);
- else if (ext_read_adv(path, devfd, &filename) < 0) {
+ if (ext_read_adv(path, devfd, &filename) < 0) {
close(devfd);
return 1;
}
More information about the Syslinux-commits
mailing list