diff options
author | Cyrill Gorcunov <gorcunov@gmail.com> | 2018-09-29 14:30:14 +0300 |
---|---|---|
committer | Cyrill Gorcunov <gorcunov@gmail.com> | 2018-09-29 14:31:26 +0300 |
commit | c713b5f994cf7b29164c3b6838b91f0499591434 (patch) | |
tree | e570d69be19bec76598b7757eda36d739b08a063 | |
parent | ab2c4dfff9b51b3a1a3768c5ed75f4ed870d9743 (diff) | |
download | nasm-c713b5f994cf7b29164c3b6838b91f0499591434.tar.gz |
preproc: parse_size -- Check for string provided
In case if the string is nil we will have sigsegv.
https://bugzilla.nasm.us/show_bug.cgi?id=3392507
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
-rw-r--r-- | asm/preproc.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/asm/preproc.c b/asm/preproc.c index 8e1e6369..b6bed9d9 100644 --- a/asm/preproc.c +++ b/asm/preproc.c @@ -2210,8 +2210,7 @@ static int parse_size(const char *str) { { "byte", "dword", "oword", "qword", "tword", "word", "yword" }; static const int sizes[] = { 0, 1, 4, 16, 8, 10, 2, 32 }; - - return sizes[bsii(str, size_names, ARRAY_SIZE(size_names))+1]; + return str ? sizes[bsii(str, size_names, ARRAY_SIZE(size_names))+1] : 0; } /* |