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>
This commit is contained in:
Cyrill Gorcunov 2014-02-15 18:40:12 +04:00
parent af10bfe167
commit d0293d3392

View File

@ -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;