Added check for null pointer while processing cmdline options. Pointer
authoretheisen <etheisen@openbsd.org>
Mon, 12 Feb 1996 07:42:26 +0000 (07:42 +0000)
committeretheisen <etheisen@openbsd.org>
Mon, 12 Feb 1996 07:42:26 +0000 (07:42 +0000)
overrun was causing SEGV if any cmdline options were specified.

games/backgammon/common_source/subs.c

index 9fb185f..ab38c95 100644 (file)
@@ -314,7 +314,7 @@ register char       ***arg;
           if the game is being recovered */
 
        s = *arg;
-       while (s[0][0] == '-') {
+       while ((s[0] != NULL) && (s[0][0] == '-')) {
                switch (s[0][1])  {
 
                /* don't ask if rules or instructions needed */