bug-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug in cvs log -wuser1,user2


From: Alexey Mahotkin
Subject: bug in cvs log -wuser1,user2
Date: Wed, 15 May 2002 01:45:14 +0400 (MSD)

Hello,

Alex Morozov <morozov(at)novosoft.ru> has found a bug (off-by-one
error) in log_parse_list() routine in log.c, which caused incorrect
handling of

                 $ cvs log -wuser1,user2

option (only the "user2" commits would get displayed).

You could see it for yourself by going to CVS' own CVS tree and doing
the

    $ cd src/
    $ cvs log -wscjones,dprice log.c 

Only Derek's commit (single one) would show up, although there are a
_lot_ of Larry's commits also.

The fix is very simple:

Index: log.c
===================================================================
RCS file: /cvsroot/cvs-nserver/cvs-nserver/src/log.c,v
retrieving revision 1.1.1.6.4.5
diff -u -r1.1.1.6.4.5 log.c
--- log.c       25 Nov 2001 20:45:30 -0000      1.1.1.6.4.5
+++ log.c       14 May 2002 21:32:16 -0000
@@ -747,7 +747,7 @@
            len = cp - argstring;
            p->key = xmalloc (len + 1);
            strncpy (p->key, argstring, len);
-           p->key[len + 1] = '\0';
+           p->key[len] = '\0';
        }
 
        if (*plist == NULL)


You could verify the correctness of this patch by contemplating on
what happens here (it is rather simple function), and looking at
output of 'cvs log'.

Sorry folks, I've been roller-skating this evening, and way fscking
tired (~2:00AM local time), so no patches to sanity.sh today :) Maybe
next day :)


BUT!  Due to a popular demand, here is the ChangeLog entry, woo-hooo
:)


2002-05-15  Alexey Mahotkin  <alexm@hsys.msk.ru>

        * log.c (log_parse_list): Fix off-by-one error which caused
        incorrect handling of 'cvs log -wuser1,user2 foo.c' command (only
        user1's commits would be passed to a server).

        (Bug found by morozov(at)novosoft.ru)


Thanks,

--alexm



reply via email to

[Prev in Thread] Current Thread [Next in Thread]