BR 3392696: nasm_quote -- fixup callers
In 41e9682efe
we've
changed the nasm_quote arguments still not all callers
were converted which could lead to nil dereference.
[hpa: no need to call strlen() for the asm/preproc.c chunk]
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
This commit is contained in:
parent
6a9d1e56c6
commit
4c3798b7e6
2 changed files with 4 additions and 2 deletions
|
@ -454,6 +454,7 @@ static char *nasm_quote_filename(const char *fn)
|
||||||
{
|
{
|
||||||
const unsigned char *p =
|
const unsigned char *p =
|
||||||
(const unsigned char *)fn;
|
(const unsigned char *)fn;
|
||||||
|
size_t len;
|
||||||
|
|
||||||
if (!p || !*p)
|
if (!p || !*p)
|
||||||
return nasm_strdup("\"\"");
|
return nasm_strdup("\"\"");
|
||||||
|
@ -477,7 +478,8 @@ static char *nasm_quote_filename(const char *fn)
|
||||||
return nasm_strdup(fn);
|
return nasm_strdup(fn);
|
||||||
|
|
||||||
quote:
|
quote:
|
||||||
return nasm_quote(fn, NULL);
|
len = strlen(fn);
|
||||||
|
return nasm_quote(fn, &len);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void timestamp(void)
|
static void timestamp(void)
|
||||||
|
|
|
@ -797,7 +797,7 @@ Token *quote_token(Token *t)
|
||||||
*/
|
*/
|
||||||
static Token *quote_any_token(Token *t)
|
static Token *quote_any_token(Token *t)
|
||||||
{
|
{
|
||||||
size_t len;
|
size_t len = t->len;
|
||||||
char *p;
|
char *p;
|
||||||
|
|
||||||
p = nasm_quote(tok_text(t), &len);
|
p = nasm_quote(tok_text(t), &len);
|
||||||
|
|
Loading…
Reference in a new issue