Subject: quiz bug
To: None <netbsd-bugs@sun-lamp.cs.berkeley.edu>
From: Szabolcs Szigeti (PinkPanther) <pink@bagira.fsz.bme.hu>
List: netbsd-bugs
Date: 11/17/1993 12:52:28
Hi,

Here's a little bug from quiz, that makes it dump core
when using 'quiz function ed-command'.
The variable sp is unitialized.

        szabolcs

-----------> diff for /usr/src/games/quiz/quiz.c <------------

*** 1.1 1993/11/16 18:28:37
--- quiz.c      1993/11/16 18:32:51
***************
*** 310,316 ****
        register int ch;
        char *m;

!       if ((m = malloc(strlen(sp) + strlen(tp) + 1)) == NULL)
                err("%s", strerror(errno));
        for (mp = m, sp = s; *mp++ = *sp++;);

--- 310,316 ----
        register int ch;
        char *m;

!       if ((m = malloc(strlen(s) + strlen(tp) + 1)) == NULL)
                err("%s", strerror(errno));
        for (mp = m, sp = s; *mp++ = *sp++;);

--------------------> EOF <------------------------------------


------------------------------------------------------------------------------