aboutsummaryrefslogtreecommitdiffstats
path: root/extlinux
diff options
context:
space:
mode:
authorMatt Fleming <matt.fleming@intel.com>2012-11-02 17:02:36 +0000
committerMatt Fleming <matt.fleming@intel.com>2012-11-05 08:59:24 +0000
commit2a7fdfe43f7b9fc6360fe67b023f17ebb23a996c (patch)
tree093bb81874026b68f62af729f50574b4520f6e1a /extlinux
parent7307d60063ee4303da4de45f9d984fdc8df92146 (diff)
downloadsyslinux-2a7fdfe43f7b9fc6360fe67b023f17ebb23a996c.tar.gz
syslinux-2a7fdfe43f7b9fc6360fe67b023f17ebb23a996c.tar.xz
syslinux-2a7fdfe43f7b9fc6360fe67b023f17ebb23a996c.zip
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@citrix.com> Signed-off-by: Matt Fleming <matt.fleming@intel.com>
Diffstat (limited to 'extlinux')
-rw-r--r--extlinux/main.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/extlinux/main.c b/extlinux/main.c
index f0d8e11b..dbf538a1 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;
}