From c713b5f994cf7b29164c3b6838b91f0499591434 Mon Sep 17 00:00:00 2001 From: Cyrill Gorcunov Date: Sat, 29 Sep 2018 14:30:14 +0300 Subject: [PATCH] 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 --- asm/preproc.c | 3 +-- 1 file changed, 1 insertion(+), 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; } /* -- 2.11.4.GIT