Prevent a crash if p==NULL (due to buggy input)
This commit is contained in:
parent
794a37339a
commit
ba2842b55a
|
|
@ -1167,12 +1167,20 @@ INPparseNode *PT_mkfnode(const char *fname, INPparseNode * arg)
|
||||||
p->function = funcs[i].funcptr;
|
p->function = funcs[i].funcptr;
|
||||||
p->data = NULL;
|
p->data = NULL;
|
||||||
|
|
||||||
if(p->funcnum == PTF_PWL)
|
if (p->funcnum == PTF_PWL) {
|
||||||
p = prepare_PTF_PWL(p);
|
p = prepare_PTF_PWL(p);
|
||||||
|
if (p == NULL) {
|
||||||
|
fprintf(stderr, "Error while parsing function '%s'\n", buf);
|
||||||
|
if (ft_stricterror)
|
||||||
|
controlled_exit(EXIT_BAD);
|
||||||
|
return mkfirst(NULL, arg);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (p->funcnum == PTF_DDT)
|
if (p->funcnum == PTF_DDT)
|
||||||
p = prepare_PTF_DDT(p);
|
p = prepare_PTF_DDT(p);
|
||||||
|
|
||||||
|
|
||||||
return (p);
|
return (p);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue