mirror of
https://github.com/netwide-assembler/nasm.git
synced 2025-04-18 18:50:23 +08:00
BR 3392696: nasm_quote -- fixup callers
In 41e9682efed7cd1df133b1b4ac806e07723f1486 we've changed the nasm_quote arguments still not all callers were converted which could lead to nil dereference. Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
This commit is contained in:
parent
b14dbb95a1
commit
6c300aa488
@ -454,6 +454,7 @@ static char *nasm_quote_filename(const char *fn)
|
||||
{
|
||||
const unsigned char *p =
|
||||
(const unsigned char *)fn;
|
||||
size_t len;
|
||||
|
||||
if (!p || !*p)
|
||||
return nasm_strdup("\"\"");
|
||||
@ -477,7 +478,8 @@ static char *nasm_quote_filename(const char *fn)
|
||||
return nasm_strdup(fn);
|
||||
|
||||
quote:
|
||||
return nasm_quote(fn, NULL);
|
||||
len = strlen(fn);
|
||||
return nasm_quote(fn, &len);
|
||||
}
|
||||
|
||||
static void timestamp(void)
|
||||
|
@ -797,10 +797,11 @@ Token *quote_token(Token *t)
|
||||
*/
|
||||
static Token *quote_any_token(Token *t)
|
||||
{
|
||||
size_t len;
|
||||
const char *s = tok_text(t);
|
||||
size_t len = strlen(s);
|
||||
char *p;
|
||||
|
||||
p = nasm_quote(tok_text(t), &len);
|
||||
p = nasm_quote(s, &len);
|
||||
t->type = TOK_STRING;
|
||||
return set_text_free(t, p, len);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user