Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 12 Jun 2001 14:29:53 +0200 (CEST)
From:      Andre Albsmeier <andre.albsmeier@mchp.siemens.de>
To:        FreeBSD-gnats-submit@freebsd.org
Subject:   ports/28099: [PATCH] for segfaults in cucipop port
Message-ID:  <200106121229.f5CCTrw22236@curry.mchp.siemens.de>

next in thread | raw e-mail | index | archive | help

>Number:         28099
>Category:       ports
>Synopsis:       [PATCH] for segfaults in cucipop port
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    freebsd-ports
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Tue Jun 12 05:40:01 PDT 2001
>Closed-Date:
>Last-Modified:
>Originator:     Andre Albsmeier
>Release:        FreeBSD 4.3-STABLE i386
>Organization:
>Environment:

All systems using mail/cucipop.

>Description:

cucipop segfaults when accessing a mailbox with 512 messages.

It is a bug in cucipop-1.31.tar.gz; however, the package
seems to be unmaintained so the patch might go into the 
FreeBSD ports collection.

>How-To-Repeat:

Install cucipop, create a mailbox which holds 512 messages,
log into cucipop.

The bug can occur if the mailbox holds exactly  GROWSTEP (16) * n
messages. I need 512 messages here to reproduce it reliably.

>Fix:

--- cucipop.c.ORI	Mon Jun 11 19:13:22 2001
+++ cucipop.c	Mon Jun 11 19:13:43 2001
@@ -314,7 +314,7 @@
 
 static void addblock(const off_t start)
 { if(msgs_filled==msgs_max&&
-   !(msgs=realloc(msgs,(msgs_max+=GROWSTEP)*sizeof*msgs)))
+   !(msgs=realloc(msgs,((msgs_max+=GROWSTEP)+1)*sizeof*msgs)))
      outofmem();
   msgs[msgs_filled].order=msgs_filled;msgs[msgs_filled].start=start;
   msgs[msgs_filled].virtsize=0;msgs[msgs_filled++].deleted=0;
>Release-Note:
>Audit-Trail:
>Unformatted:

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-ports" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200106121229.f5CCTrw22236>