Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions asm/pragma.c
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,15 @@ void process_pragma(char *str)
* interior spaces.
*/
p = nasm_zap_spaces_fwd(p);
if (p == NULL) {
/* Missing opname and/or options; avoid a NULL-pointer
* dereference in strlen() below. Report it explicitly
* instead of crashing. */
nasm_error(ERR_NONFATAL, "bad argument to %%pragma %s: missing opname",
pragma.facility_name ? pragma.facility_name : "");
pragma.tail = NULL;
return;
}
pragma.tail = p;
p += strlen(p);
while (p > pragma.tail && nasm_isspace(p[-1]))
Expand Down