From owner-freebsd-ports-bugs@FreeBSD.ORG Fri Feb 2 17:20:15 2007 Return-Path: X-Original-To: freebsd-ports-bugs@hub.freebsd.org Delivered-To: freebsd-ports-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id E03FA16A407 for ; Fri, 2 Feb 2007 17:20:14 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [69.147.83.40]) by mx1.freebsd.org (Postfix) with ESMTP id A893213C4AA for ; Fri, 2 Feb 2007 17:20:14 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.13.4/8.13.4) with ESMTP id l12HKELB031486 for ; Fri, 2 Feb 2007 17:20:14 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.13.4/8.13.4/Submit) id l12HKE4o031485; Fri, 2 Feb 2007 17:20:14 GMT (envelope-from gnats) Resent-Date: Fri, 2 Feb 2007 17:20:14 GMT Resent-Message-Id: <200702021720.l12HKE4o031485@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-ports-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Kevin Oberman Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 8D54016A400 for ; Fri, 2 Feb 2007 17:17:02 +0000 (UTC) (envelope-from SRS1=390d647cd3d8ad0bccf61a438cdbbcb5edf0dd7f=es.net==390d647cd3d8ad0bccf61a438cdbbcb5edf0dd7f=234=es.net=oberman@es.net) Received: from postal1.es.net (postal1.es.net [198.128.3.205]) by mx1.freebsd.org (Postfix) with ESMTP id 740B113C47E for ; Fri, 2 Feb 2007 17:17:00 +0000 (UTC) (envelope-from SRS1=390d647cd3d8ad0bccf61a438cdbbcb5edf0dd7f=es.net==390d647cd3d8ad0bccf61a438cdbbcb5edf0dd7f=234=es.net=oberman@es.net) Received: from postal4.es.net (postal4.es.net [198.124.252.66]) by postal1.es.net (Postal Node 1) with ESMTP (SSL) id HTG33842 for ; Fri, 02 Feb 2007 09:04:42 -0800 Received: from postal2.es.net (postal2.es.net [198.128.3.206]) by postal4.es.net (Postal Node 4) with ESMTP (SSL) id HTG40238 for ; Fri, 02 Feb 2007 09:04:38 -0800 Received: from ptavv.es.net (ptavv.es.net [198.128.4.29]) by postal2.es.net (Postal Node 2) with ESMTP (SSL) id HTG30937 for ; Fri, 02 Feb 2007 09:04:37 -0800 Received: by ptavv.es.net (Tachyon Server, from userid 9381) id 1CB8645055; Fri, 2 Feb 2007 09:04:37 -0800 (PST) Message-Id: <20070202170437.1CB8645055@ptavv.es.net> Date: Fri, 2 Feb 2007 09:04:37 -0800 (PST) From: Kevin Oberman To: FreeBSD-gnats-submit@FreeBSD.org X-Send-Pr-Version: 3.113 Cc: Subject: ports/108693: Maintainer update of irrtoolset port to eliminate segfaults X-BeenThere: freebsd-ports-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Kevin Oberman List-Id: Ports bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Feb 2007 17:20:15 -0000 >Number: 108693 >Category: ports >Synopsis: Maintainer update of irrtoolset port to eliminate segfaults >Confidential: no >Severity: serious >Priority: medium >Responsible: freebsd-ports-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: maintainer-update >Submitter-Id: current-users >Arrival-Date: Fri Feb 02 17:20:14 GMT 2007 >Closed-Date: >Last-Modified: >Originator: Kevin Oberman >Release: FreeBSD 6.2-STABLE i386 >Organization: ESnet-The Energy Sciences Network >Environment: System: FreeBSD ptavv.es.net 6.2-STABLE FreeBSD 6.2-STABLE #6: Mon Jan 22 13:25:14 PST 2007 root@ptavv.es.net:/usr/obj/usr/src/sys/PTAVV i386 >Description: There is a bug in the current release that will cause frequent segmentation faults on many operations. >How-To-Repeat: Run peval repeatedly on a V6 system and it will eventually crash. >Fix: Add the following file as files/patch-src-irr-rawhoisc.cc and bump PORTREVISION (to 1). --- src/irr/rawhoisc.cc.orig Thu Jun 8 08:16:26 2006 +++ src/irr/rawhoisc.cc Tue Jan 23 15:14:24 2007 @@ -1,4 +1,4 @@ -// $Id: rawhoisc.cc,v 4.11 2006/06/08 15:16:26 shane Exp $ +// $Id: rawhoisc.cc,v 4.11.10.1 2006/12/08 08:33:52 shane Exp $ // Copyright (c) 2001,2002 RIPE NCC // // All Rights Reserved @@ -187,7 +187,7 @@ } void RAWhoisClient::GetVersion() { - char *buffer = (char *) calloc (80,1); + char *buffer; char *start; if (! _is_open) @@ -199,7 +199,7 @@ start = start + 8; //jump version = atoi(start)*10 + atoi(start+2); // x.x... format Trace(TR_WHOIS_RESPONSE) << "Whois: Response " << buffer << endl; - free(buffer); + delete [] buffer; } void RAWhoisClient::SetSources(const char *_sources) { @@ -298,9 +298,11 @@ return 0; } if (is_rpslng()) { - response = strdup(""); - char *prev; + response = new char[1]; + response[0] = '\0'; + char *prev = NULL; do { + free(prev); prev = strdup(buffer); Trace(TR_WHOIS_RESPONSE) << "Whois: Response <<\n" << buffer <<">>"<< endl; if (strstr (buffer, "route") || strstr(buffer, "route6")) { @@ -315,18 +317,20 @@ // save response tmp = strdup (response); // allocate new string + delete [] response; response = new char [strlen(tmp) + strlen(end_prefix) + 2]; - memset(response, 0, strlen(response)); // copy old and new response - strncat (response, tmp, strlen(tmp)); - strncat (response, " ", 1); - strncat (response, end_prefix, strlen(end_prefix)); + strcpy(response, tmp); + strcat(response, " "); + strcat(response, end_prefix); free(tmp); } } while (fgets(buffer, sizeof(buffer), in) && // this condition should work with irrd version >= 2.2b19 // until then, ripe-style queries won't work with persistent connections !((*prev == '\n') && (*buffer == '\n'))); + + free(prev); // The WHOIS protocol and RPSL give no indication of // end of a protocol data unit, so we need to keep >Release-Note: >Audit-Trail: >Unformatted: