Prevent crash if number of lines is wrong/not available ...

This commit is contained in:
Holger Vogt 2024-10-27 15:17:51 +01:00
parent 5079b42f26
commit 8e05683592
1 changed files with 5 additions and 0 deletions

View File

@ -311,6 +311,11 @@ nupa_init(void)
dicoS = TMALLOC(dico_t, 1);
initdico(dicoS);
if (dynmaxline < 1) {
fprintf(stderr, "Error: not a valid input deck, check your netlist\n");
controlled_exit(EXIT_BAD);
}
dicoS->dynrefptr = TMALLOC(char*, dynmaxline + 1);
dicoS->dyncategory = TMALLOC(char, dynmaxline + 1);