[Top][All Lists]

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

Re: cvs cores when no log message

From: Mark D. Baushke
Subject: Re: cvs cores when no log message
Date: Sat, 15 Feb 2003 17:06:47 -0800

Piotr KUCHARSKI <chopin@sgh.waw.pl> writes:

> --- cvs-1.11.5/src/logmsg.c     Fri Sep 20 04:48:59 2002
> +++ cvs-1.11.5/src/logmsg.c.new Sun Feb 16 01:29:58 2003
> @@ -927,6 +927,7 @@
>      }
>      setup_tmpfile (pipefp, "", changes);
> +    if (message)
>      (void) fprintf (pipefp, "Log Message:\n%s\n", message);

Actually, a number of stdio implementations replace %s of a NULL
pointer with "(null)" so that might be a better patch... more than
one commit script might be looking for the "Log Message:" text for
whatever reasons of its own...

However, it would be even better to find the root cause where a NULL
pointer is getting into message rather than an xstrdup of "" ... do you
have a test case? Is this in import or commit ? Is it the result of a
verifymsg script rewriting the message or not?

More details please. Could you give a test case that shows this problem?
Could you also include information on what system you have?

        -- Mark

ChangeLog message:

        * logmsg.c (logfile_write): Hack to stop core dumps by
        printing "(null)" when the message is NULL. This is not
        really the right way to solve this problem.
Index: logmsg.c
RCS file: /cvs/ccvs/src/logmsg.c,v
retrieving revision 1.62
diff -u -p -r1.62 logmsg.c
--- logmsg.c    29 Aug 2002 05:00:59 -0000      1.62
+++ logmsg.c    16 Feb 2003 00:55:00 -0000
@@ -927,7 +927,8 @@ logfile_write (repository, filter, messa
     setup_tmpfile (pipefp, "", changes);
-    (void) fprintf (pipefp, "Log Message:\n%s\n", message);
+    (void) fprintf (pipefp, "Log Message:\n%s\n",
+                   (message) ? message : "(null)");
     if (logfp != (FILE *) 0)
        (void) fprintf (pipefp, "Status:\n");

reply via email to

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