mirror of
https://github.com/netwide-assembler/nasm.git
synced 2025-02-05 16:51:27 +08:00
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>
This commit is contained in:
parent
ab2c4dfff9
commit
c713b5f994
@ -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;
|
||||
}
|
||||
|
||||
/*
|
||||
|
Loading…
Reference in New Issue
Block a user