mirror of
https://github.com/netwide-assembler/nasm.git
synced 2024-12-27 09:29:06 +08:00
preproc: reject NUL characters in %deftok directives
We could either error out or convert them to whitespace; this implements the error option. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
This commit is contained in:
parent
466ba97d68
commit
2f55bdaaca
@ -3002,6 +3002,9 @@ static int do_directive(Token * tline)
|
||||
|
||||
case PP_DEFTOK:
|
||||
case PP_IDEFTOK:
|
||||
{
|
||||
size_t len;
|
||||
|
||||
casesense = (i == PP_DEFTOK);
|
||||
|
||||
tline = tline->next;
|
||||
@ -3034,7 +3037,10 @@ static int do_directive(Token * tline)
|
||||
return DIRECTIVE_FOUND;
|
||||
}
|
||||
|
||||
nasm_unquote(t->text, NULL);
|
||||
len = nasm_unquote(t->text, NULL);
|
||||
if (memchr(t->text, '\0', len))
|
||||
error(ERR_NONFATAL, "NUL character in `%s' directive",
|
||||
pp_directives[i]);
|
||||
macro_start = tokenize(t->text);
|
||||
|
||||
/*
|
||||
@ -3046,6 +3052,7 @@ static int do_directive(Token * tline)
|
||||
free_tlist(tline);
|
||||
free_tlist(origline);
|
||||
return DIRECTIVE_FOUND;
|
||||
}
|
||||
|
||||
case PP_PATHSEARCH:
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user