[Top][All Lists]

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

Unitilialized CVSroot makes cvs- dump core

From: Martin Neitzel
Subject: Unitilialized CVSroot makes cvs- dump core
Date: Fri, 1 Oct 2004 19:11:42 +0200 (CEST)

>Submitter-Id:   net
>Originator:     Martin Neitzel
>Organization:  Gaertner Datensysteme
>Confidential:  no
>Synopsis:      Unitilialized CVSroot make cvs- dump core
>Severity:      critical
>Priority:      high
>Category:      cvs
>Class:         sw-bug
        Any HAVE_PUTENV platform with a bleeding edge main.c rev. 1.221
        (2004/09/24) or higher.

        Cvs will dump core if when invoked when the repository is defined
        through a CVS/Root file and no CVSROOT envvar or "-d repo" cmdline
        is in place.

        Run any cvs command, say, "cvs stat" in a working directory.

        The reason behind the core dump is essentially an uninitialized
        "CVSroot" variable.  It shows up when main.c tries to putenv
        the final "CVSROOT" (strlen(NULL) in main.c, line 989 for -r 1.223)

        The following patch re-introduces the initialization.
        It may also resolve the "FIXME (njc)" comment in line 984
        prior to the strlen/putenv in line .

Index: src/main.c
RCS file: /cvs/ccvs/src/main.c,v
retrieving revision 1.223
diff -u -r1.223 main.c
--- src/main.c  29 Sep 2004 20:47:14 -0000      1.223
+++ src/main.c  1 Oct 2004 14:06:49 -0000
@@ -877,6 +877,7 @@
            if (CVSADM_Root && (!CVSroot || !cvs_update_env))
                CVSroot_parsed = CVSADM_Root;
+               CVSroot = CVSADM_Root->original;
                cvs_update_env = 1;     /* need to update environment */
            else if (!*CVSroot)

reply via email to

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