cvsclient.c: don't return trash buffer when 'E ' is returned from first 'cvs rlog...
authorSergei Trofimovich <slyfox@gentoo.org>
Wed, 9 Jan 2013 09:56:57 +0000 (12:56 +0300)
committerEric S. Raymond <esr@thyrsus.com>
Wed, 9 Jan 2013 15:46:10 +0000 (10:46 -0500)
commitc4b06934ede0ad50b4d88c6d7cc0bf86bc9ebb39
treed47771c25ecbc4d908a0b9875ea1d3ec80019eba
parentea0d2d7d2698bd52d6582ea7b9b4b30f29d6a788
cvsclient.c: don't return trash buffer when 'E ' is returned from first 'cvs rlog' entries

Found by valgrind:

    $ valgrind ./cvsps --fast-export --root $CVSROOT -p z/ --debuglvl 0xff Kernel

    cvsps: cvsclient: rlog: read E cvs rlog: Logging Kernel
    cvsps: cvs rlog: Logging Kernel
    ==27619== Conditional jump or move depends on uninitialised value(s)
    ==27619==    at 0x50938F2: vfprintf (vfprintf.c:1642)
    ==27619==    by 0x514361F: __vsnprintf_chk (vsnprintf_chk.c:63)
    ==27619==    by 0x10B7D4: vdebug (stdio2.h:77)
    ==27619==    by 0x10CFED: debug (debug.h:52)
    ==27619==    by 0x11095B: load_from_cvs (cvsps.c:338)
    ==27619==    by 0x10AA19: main (cvsps.c:197)
    ==27619==  Uninitialised value was created by a stack allocation
    ==27619==    at 0x11089F: load_from_cvs (cvsps.c:301)

Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
Signed-off-by: Eric S. Raymond <esr@thyrsus.com>
cvsclient.c