diff options
author | Cyrill Gorcunov <gorcunov@gmail.com> | 2010-10-02 01:21:00 +0400 |
---|---|---|
committer | Cyrill Gorcunov <gorcunov@gmail.com> | 2010-10-02 01:21:00 +0400 |
commit | 9e8f0ac460dfa83bc05f3b42bb9293ad21e39ae7 (patch) | |
tree | 61e74d73ca050789fc219f99c20879ce182a0f70 /output | |
parent | d4ddfac484a89337d64f666bd08b3656346439c3 (diff) | |
download | nasm-9e8f0ac460dfa83bc05f3b42bb9293ad21e39ae7.tar.gz nasm-9e8f0ac460dfa83bc05f3b42bb9293ad21e39ae7.tar.bz2 nasm-9e8f0ac460dfa83bc05f3b42bb9293ad21e39ae7.zip |
BR3079550: NASM crash on run-time for OMF output format
We could have accessed malloc'ed data on external symbols
in obj and ieee output formats. Fix it by using nasm_zalloc.
Reported-by: Jiri Malak
Patch-by: Jiri Malak
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
Diffstat (limited to 'output')
-rw-r--r-- | output/outieee.c | 4 | ||||
-rw-r--r-- | output/outobj.c | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/output/outieee.c b/output/outieee.c index c6923fd..a8f6901 100644 --- a/output/outieee.c +++ b/output/outieee.c @@ -372,7 +372,7 @@ static void ieee_deflabel(char *name, int32_t segment, i = segment / 2; eb = ebhead; if (!eb) { - eb = *ebtail = nasm_malloc(sizeof(*eb)); + eb = *ebtail = nasm_zalloc(sizeof(*eb)); eb->next = NULL; ebtail = &eb->next; } @@ -380,7 +380,7 @@ static void ieee_deflabel(char *name, int32_t segment, if (eb && eb->next) eb = eb->next; else { - eb = *ebtail = nasm_malloc(sizeof(*eb)); + eb = *ebtail = nasm_zalloc(sizeof(*eb)); eb->next = NULL; ebtail = &eb->next; } diff --git a/output/outobj.c b/output/outobj.c index e62bc3f..b07a7e4 100644 --- a/output/outobj.c +++ b/output/outobj.c @@ -993,7 +993,7 @@ static void obj_deflabel(char *name, int32_t segment, i = segment / 2; eb = ebhead; if (!eb) { - eb = *ebtail = nasm_malloc(sizeof(*eb)); + eb = *ebtail = nasm_zalloc(sizeof(*eb)); eb->next = NULL; ebtail = &eb->next; } @@ -1001,7 +1001,7 @@ static void obj_deflabel(char *name, int32_t segment, if (eb && eb->next) eb = eb->next; else { - eb = *ebtail = nasm_malloc(sizeof(*eb)); + eb = *ebtail = nasm_zalloc(sizeof(*eb)); eb->next = NULL; ebtail = &eb->next; } |