diff options
author | Cyrill Gorcunov <gorcunov@gmail.com> | 2014-02-15 18:40:12 +0400 |
---|---|---|
committer | Cyrill Gorcunov <gorcunov@gmail.com> | 2014-02-15 18:40:12 +0400 |
commit | d0293d339272af18b2258d702d3e1e44c0501292 (patch) | |
tree | 8866d08063a3a5d563dbdff8bf5e20220e895bb8 /output | |
parent | af10bfe167d6dac990b25b4b88aafb9f6709fb20 (diff) | |
download | nasm-d0293d339272af18b2258d702d3e1e44c0501292.tar.gz nasm-d0293d339272af18b2258d702d3e1e44c0501292.tar.bz2 nasm-d0293d339272af18b2258d702d3e1e44c0501292.zip |
BR3392274: output: Elf -- Don't crash on erronious syntax
Elf align section attribute requires syntax "align=value",
but in case if '=' is missed we pass nil pointer into
atoi function which cause libc to crash.
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
Diffstat (limited to 'output')
-rw-r--r-- | output/outelf.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/output/outelf.c b/output/outelf.c index 9ec0035..bfbf625 100644 --- a/output/outelf.c +++ b/output/outelf.c @@ -76,7 +76,7 @@ void section_attrib(char *name, char *attr, int pass, return; while ((opt = nasm_opt_val(opt, &val, &next))) { - if (!nasm_stricmp(opt, "align")) { + if (!nasm_stricmp(opt, "align") && val) { *align = atoi(val); if (*align == 0) { *align = SHA_ANY; |