From a28784d6d782e3e001ffada70a10daf7980cafd3 Mon Sep 17 00:00:00 2001 From: Holger Vogt Date: Tue, 13 Jun 2023 20:05:49 +0200 Subject: [PATCH] Prevent crash if *line == NULL --- src/spicelib/parser/inpgtok.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/spicelib/parser/inpgtok.c b/src/spicelib/parser/inpgtok.c index 58ece2fc1..be17a1a3f 100644 --- a/src/spicelib/parser/inpgtok.c +++ b/src/spicelib/parser/inpgtok.c @@ -31,6 +31,11 @@ INPgetTok(char **line, char **token, int gobble) char *point; int signstate; + if (!*line) { + *token = NULL; + return (E_PARMVAL); + } + /* scan along throwing away garbage characters until end of line or a separation char is found */ for (point = *line; *point != '\0'; point++) {