summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCyrill Gorcunov <gorcunov@gmail.com>2014-02-15 18:40:12 +0400
committerCyrill Gorcunov <gorcunov@gmail.com>2014-02-15 18:40:12 +0400
commitd0293d339272af18b2258d702d3e1e44c0501292 (patch)
tree8866d08063a3a5d563dbdff8bf5e20220e895bb8
parentaf10bfe167d6dac990b25b4b88aafb9f6709fb20 (diff)
downloadnasm-d0293d339272af18b2258d702d3e1e44c0501292.tar.gz
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>
-rw-r--r--output/outelf.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/output/outelf.c b/output/outelf.c
index 9ec00354..bfbf6259 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;