gettok_node(), avoid segfault when *s == NULL

This commit is contained in:
Krzysztof Blaszkowski 2013-10-13 22:41:49 +02:00 committed by rlar
parent 23cdd5e53f
commit 493aaba468
1 changed files with 3 additions and 0 deletions

View File

@ -443,6 +443,9 @@ gettok_node(char **s)
char *token ; /* return token */
SPICE_DSTRING buf ; /* allow any length string */
if (*s == NULL)
return NULL;
while (isspace(**s) ||
( **s == '(' ) ||
( **s == ')' ) ||