Your message dated Tue, 09 Aug 2005 05:47:04 -0700
with message-id <[EMAIL PROTECTED]>
and subject line Bug#315024: fixed in cvsps 2.1-1
has caused the attached Bug report to be marked as done.
This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.
(NB: If you are a system administrator and have no idea what I am
talking about this indicates a serious mail system misconfiguration
somewhere. Please contact me immediately.)
Debian bug tracking system administrator
(administrator, Debian Bugs database)
--------------------------------------
Received: (at submit) by bugs.debian.org; 20 Jun 2005 06:05:24 +0000
>From [EMAIL PROTECTED] Sun Jun 19 23:05:24 2005
Return-path: <[EMAIL PROTECTED]>
Received: from sccmmhc91.asp.att.net [204.127.203.211]
by spohr.debian.org with esmtp (Exim 3.35 1 (Debian))
id 1DkFPQ-0000Fm-00; Sun, 19 Jun 2005 23:05:24 -0700
Received: from mail.kilzer.net ([12.216.13.146])
by sccmmhc91.asp.att.net (sccmmhc91) with ESMTP
id <20050620060453m9100ngbfte>; Mon, 20 Jun 2005 06:04:53 +0000
Received: from localhost (localhost [127.0.0.1])
by mail.kilzer.net (Postfix) with ESMTP id BA3BBC2681;
Mon, 20 Jun 2005 01:04:52 -0500 (CDT)
Received: from mail.kilzer.net ([127.0.0.1])
by localhost (tweek [127.0.0.1]) (amavisd-new, port 10024) with LMTP
id 16301-04-2; Mon, 20 Jun 2005 01:04:35 -0500 (CDT)
Received: by mail.kilzer.net (Postfix, from userid 1000)
id 5683EC2680; Mon, 20 Jun 2005 01:04:35 -0500 (CDT)
Content-Type: multipart/mixed; boundary="===============0818136220=="
MIME-Version: 1.0
From: "David D. Kilzer" <[EMAIL PROTECTED]>
To: Debian Bug Tracking System <[EMAIL PROTECTED]>
Subject: cvsps: dynamically allocate the log buffer to prevent warning messages
X-Mailer: reportbug 3.14
Date: Mon, 20 Jun 2005 01:04:34 -0500
Message-Id: <[EMAIL PROTECTED]>
X-Virus-Scanned: by amavisd-new-20030616-p10 (Debian) at kilzer.net
Delivered-To: [EMAIL PROTECTED]
X-Spam-Checker-Version: SpamAssassin 2.60-bugs.debian.org_2005_01_02
(1.212-2003-09-23-exp) on spohr.debian.org
X-Spam-Status: No, hits=-8.0 required=4.0 tests=BAYES_00,HAS_PACKAGE
autolearn=no version=2.60-bugs.debian.org_2005_01_02
X-Spam-Level:
This is a multi-part MIME message sent by reportbug.
--===============0818136220==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
Package: cvsps
Version: 2.0rc1-5
Severity: normal
Tags: patch
On anoncvs.opensource.apple.com (Apple's anonymous CVS server for
WebKit), some very long log entries were included in CVS. I got tired
of cvsps-2.1 truncating them, so I made the 'logbuff' buffer be
dynamically allocated.
Patch attached to implement this feature.
-- System Information:
Debian Release: testing/unstable
APT prefers unstable
APT policy: (500, 'unstable')
Architecture: powerpc (ppc)
Shell: /bin/sh linked to /bin/bash
Kernel: Linux 2.4.20-ben7
Locale: LANG=C, LC_CTYPE=C (charmap=ANSI_X3.4-1968)
Versions of packages cvsps depends on:
ii cvs 1:1.12.9-13 Concurrent Versions System
ii libc6 2.3.2.ds1-22 GNU C Library: Shared libraries an
ii zlib1g 1:1.2.2-4 compression library - runtime
cvsps recommends no packages.
-- no debconf information
--===============0818136220==
Content-Type: text/x-c; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
filename="cvsps-2.1-alloc-logbuff-dynamically.diff"
diff -urN cvsps-2.1.orig/cache.c cvsps-2.1/cache.c
--- cvsps-2.1.orig/cache.c 2005-05-25 22:39:40.000000000 -0500
+++ cvsps-2.1/cache.c 2005-06-19 21:41:25.000000000 -0500
@@ -108,10 +108,19 @@
int tag_flags = 0;
char branchbuff[LOG_STR_MAX] = "";
int branch_add = 0;
- char logbuff[LOG_STR_MAX] = "";
+ int logbufflen = LOG_STR_MAX + 1;
+ char * logbuff = malloc(logbufflen);
time_t cache_date = -1;
int read_version;
+ if (logbuff == NULL)
+ {
+ debug(DEBUG_SYSERROR, "could not malloc %d bytes for logbuff in
read_cache", logbufflen);
+ exit(1);
+ }
+
+ logbuff[0] = 0;
+
if (!(fp = cache_open("r")))
goto out;
@@ -299,8 +308,19 @@
else
{
/* Make sure we have enough in the buffer */
- if (strlen(logbuff)+strlen(buff)<LOG_STR_MAX)
- strcat(logbuff, buff);
+ int len = strlen(buff);
+ if (strlen(logbuff) + len >= LOG_STR_MAX)
+ {
+ logbufflen += (len > LOG_STR_MAX ? len : LOG_STR_MAX);
+ char * newlogbuff = realloc(logbuff, logbufflen);
+ if (newlogbuff == NULL)
+ {
+ debug(DEBUG_SYSERROR, "could not realloc %d bytes for
logbuff in read_cache", logbufflen);
+ exit(1);
+ }
+ logbuff = newlogbuff;
+ }
+ strcat(logbuff, buff);
}
break;
case CACHE_NEED_PS_MEMBERS:
@@ -332,6 +352,7 @@
out_close:
fclose(fp);
out:
+ free(logbuff);
return cache_date;
}
diff -urN cvsps-2.1.orig/cvsps.c cvsps-2.1/cvsps.c
--- cvsps-2.1.orig/cvsps.c 2005-05-25 22:39:40.000000000 -0500
+++ cvsps-2.1/cvsps.c 2005-06-19 23:07:20.000000000 -0500
@@ -265,7 +265,8 @@
PatchSetMember * psm = NULL;
char datebuff[20];
char authbuff[AUTH_STR_MAX];
- char logbuff[LOG_STR_MAX + 1];
+ int logbufflen = LOG_STR_MAX + 1;
+ char * logbuff = malloc(logbufflen);
int loglen = 0;
int have_log = 0;
char cmd[BUFSIZ];
@@ -273,6 +274,12 @@
char use_rep_buff[PATH_MAX];
char * ltype;
+ if (logbuff == NULL)
+ {
+ debug(DEBUG_SYSERROR, "could not malloc %d bytes for logbuff in
load_from_cvs", logbufflen);
+ exit(1);
+ }
+
if (!no_rlog && !test_log_file && cvs_check_cap(CAP_HAVE_RLOG))
{
ltype = "rlog";
@@ -480,24 +487,22 @@
*/
if (have_log || !is_revision_metadata(buff))
{
- /* if the log buffer is full, that's it.
- *
- * Also, read lines (fgets) always have \n in them
- * which we count on. So if truncation happens,
- * be careful to put a \n on.
- *
- * Buffer has LOG_STR_MAX + 1 for room for \0 if
- * necessary
- */
- if (loglen < LOG_STR_MAX)
+ /* If the log buffer is full, try to reallocate more. */
+ if (loglen < logbufflen)
{
int len = strlen(buff);
- if (len >= LOG_STR_MAX - loglen)
+ if (len >= logbufflen - loglen)
{
- debug(DEBUG_APPMSG1, "WARNING: maximum log length
exceeded, truncating log");
- len = LOG_STR_MAX - loglen;
- buff[len - 1] = '\n';
+ debug(DEBUG_STATUS, "reallocating logbufflen to %d
bytes for file %s", logbufflen, file->filename);
+ logbufflen += (len > LOG_STR_MAX ? len :
LOG_STR_MAX);
+ char * newlogbuff = realloc(logbuff, logbufflen);
+ if (newlogbuff == NULL)
+ {
+ debug(DEBUG_SYSERROR, "could not realloc %d
bytes for logbuff in load_from_cvs", logbufflen);
+ exit(1);
+ }
+ logbuff = newlogbuff;
}
debug(DEBUG_STATUS, "appending %s to log", buff);
--===============0818136220==--
---------------------------------------
Received: (at 315024-close) by bugs.debian.org; 9 Aug 2005 12:49:25 +0000
>From [EMAIL PROTECTED] Tue Aug 09 05:49:25 2005
Return-path: <[EMAIL PROTECTED]>
Received: from katie by spohr.debian.org with local (Exim 3.36 1 (Debian))
id 1E2TVY-0007f0-00; Tue, 09 Aug 2005 05:47:04 -0700
From: Marcus Crafter <[EMAIL PROTECTED]>
To: [EMAIL PROTECTED]
X-Katie: $Revision: 1.56 $
Subject: Bug#315024: fixed in cvsps 2.1-1
Message-Id: <[EMAIL PROTECTED]>
Sender: Archive Administrator <[EMAIL PROTECTED]>
Date: Tue, 09 Aug 2005 05:47:04 -0700
Delivered-To: [EMAIL PROTECTED]
X-Spam-Checker-Version: SpamAssassin 2.60-bugs.debian.org_2005_01_02
(1.212-2003-09-23-exp) on spohr.debian.org
X-Spam-Level:
X-Spam-Status: No, hits=-6.0 required=4.0 tests=BAYES_00,HAS_BUG_NUMBER
autolearn=no version=2.60-bugs.debian.org_2005_01_02
X-CrossAssassin-Score: 4
Source: cvsps
Source-Version: 2.1-1
We believe that the bug you reported is fixed in the latest version of
cvsps, which is due to be installed in the Debian FTP archive:
cvsps_2.1-1.diff.gz
to pool/main/c/cvsps/cvsps_2.1-1.diff.gz
cvsps_2.1-1.dsc
to pool/main/c/cvsps/cvsps_2.1-1.dsc
cvsps_2.1-1_i386.deb
to pool/main/c/cvsps/cvsps_2.1-1_i386.deb
cvsps_2.1.orig.tar.gz
to pool/main/c/cvsps/cvsps_2.1.orig.tar.gz
A summary of the changes between this version and the previous one is
attached.
Thank you for reporting the bug, which will now be closed. If you
have further comments please address them to [EMAIL PROTECTED],
and the maintainer will reopen the bug report if appropriate.
Debian distribution maintenance software
pp.
Marcus Crafter <[EMAIL PROTECTED]> (supplier of updated cvsps package)
(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing [EMAIL PROTECTED])
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Format: 1.7
Date: Thu, 28 Jul 2005 13:32:58 +0100
Source: cvsps
Binary: cvsps
Architecture: source i386
Version: 2.1-1
Distribution: unstable
Urgency: low
Maintainer: Marcus Crafter <[EMAIL PROTECTED]>
Changed-By: Marcus Crafter <[EMAIL PROTECTED]>
Description:
cvsps - Tool to generate CVS patch set information
Closes: 311686 314822 315023 315024
Changes:
cvsps (2.1-1) unstable; urgency=low
.
* New upstream version.
(closes: #314822)
* Applied TRUNK ignore patch from David D. Kilzer
(closes: #315023)
* Applied dynamic buffer allocation patch from David D. Kilzer
(closes: #315024)
* Applied man page typo fix from Roberto C. Sanchez
(closes: #311686)
Files:
88d36e35ff0361ce0d577a0fec023e30 571 devel optional cvsps_2.1-1.dsc
bde2110ed9f5d14de8f8cb04e9d596fe 61634 devel optional cvsps_2.1.orig.tar.gz
29d04d33c3f7ecaf4d53e0954038dcce 4280 devel optional cvsps_2.1-1.diff.gz
6cf9d38e3977e5872208a1b72b470861 46340 devel optional cvsps_2.1-1_i386.deb
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (GNU/Linux)
iD8DBQFC6NxIOU0v48TFe0IRAqz/AKC48yBWTjLKKEhX2vMmjbS2ZhkAIQCfcTuS
xlejPVGxlKC84XcsGMTPERA=
=t1X4
-----END PGP SIGNATURE-----
--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]