mirror of
https://github.com/frida/tinycc
synced 2024-11-28 02:29:38 +03:00
Make get_tok_str support NULL as second param.
As was pointed out on tinycc-devel, many uses of get_tok_str gives as second parameter the value NULL. However, that pointer was unconditionally dereferenced in get_tok_ptr. This commit explicitely add support for thas case.
This commit is contained in:
parent
5c233f2cf3
commit
9a6ee577f6
6
tccpp.c
6
tccpp.c
@ -255,9 +255,15 @@ ST_FUNC char *get_tok_str(int v, CValue *cv)
|
||||
static char buf[STRING_MAX_SIZE + 1];
|
||||
static CString cstr_buf;
|
||||
CString *cstr;
|
||||
CValue cval;
|
||||
char *p;
|
||||
int i, len;
|
||||
|
||||
if (!cv) {
|
||||
cval.ull = 0;
|
||||
cv = &cval;
|
||||
}
|
||||
|
||||
/* NOTE: to go faster, we give a fixed buffer for small strings */
|
||||
cstr_reset(&cstr_buf);
|
||||
cstr_buf.data = buf;
|
||||
|
Loading…
Reference in New Issue
Block a user