-
Notifications
You must be signed in to change notification settings - Fork 41
Open
Description
$si:ze = 1
puts $si:zethis will call null pointer dereference.
In the declareVariable()
if (isalpha(tok.tok[tok.pos].val[0])) {
tok.pos++;
if (skip(":")) {
if (skip("int")) {
--tok.pos;
return appendVar(tok.tok[npos].val, T_INT);
}
if (skip("string")) {
--tok.pos;
return appendVar(tok.tok[npos].val, T_STRING);
}
if (skip("double")) {
--tok.pos;
return appendVar(tok.tok[npos].val, T_DOUBLE);
}
} else {
--tok.pos;
return appendVar(tok.tok[npos].val, T_INT);
}
return NULL; // return NULL
int32_t assignment() {
Variable *v = getVar(tok.tok[tok.pos].val);
int32_t inc = 0, dec = 0, declare = 0;
if (v == NULL) {
declare++;
v = declareVariable(); // Null
}
....Metadata
Metadata
Assignees
Labels
No labels