Browse Source

Safeguard against bad arguments (no crash upon NULL)

pre-master-46
Holger Vogt 3 years ago
parent
commit
b24c613ce6
  1. 5
      src/spicelib/parser/inpptree.c

5
src/spicelib/parser/inpptree.c

@ -1112,6 +1112,11 @@ INPparseNode *PT_mkfnode(const char *fname, INPparseNode * arg)
return mkfirst(NULL, arg);
}
if (!arg) {
fprintf(stderr, "Error: bad function arguments \n");
return mkfirst(NULL, arg);
}
/* Make sure the case is ok. */
(void)strncpy(buf, fname, 127);
buf[127] = 0;

Loading…
Cancel
Save