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:
Cyrill Gorcunov 2018-09-29 14:30:14 +03:00
parent ab2c4dfff9
commit c713b5f994

View File

@ -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;
}
/*