From: nasm-bot f. C. G. <gor...@gm...> - 2014-02-15 14:45:36
|
Commit-ID: d0293d339272af18b2258d702d3e1e44c0501292 Gitweb: http://repo.or.cz/w/nasm.git?a=commitdiff;h=d0293d339272af18b2258d702d3e1e44c0501292 Author: Cyrill Gorcunov <gor...@gm...> AuthorDate: Sat, 15 Feb 2014 18:40:12 +0400 Committer: Cyrill Gorcunov <gor...@gm...> CommitDate: Sat, 15 Feb 2014 18:40:12 +0400 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 <gor...@gm...> --- output/outelf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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; |