mirror of
https://github.com/netwide-assembler/nasm.git
synced 2025-04-12 18:40:23 +08:00
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:
parent
af10bfe167
commit
d0293d3392
@ -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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user