projects
/
platform
/
upstream
/
nasm.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
af10bfe
)
BR3392274: output: Elf -- Don't crash on erronious syntax
author
Cyrill Gorcunov
<gorcunov@gmail.com>
Sat, 15 Feb 2014 14:40:12 +0000
(18:40 +0400)
committer
Cyrill Gorcunov
<gorcunov@gmail.com>
Sat, 15 Feb 2014 14:40:12 +0000
(18:40 +0400)
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>
output/outelf.c
patch
|
blob
|
history
diff --git
a/output/outelf.c
b/output/outelf.c
index
9ec0035
..
bfbf625
100644
(file)
--- 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;