From owner-freebsd-current@FreeBSD.ORG Thu May 8 19:51:22 2003 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 3914937B401 for ; Thu, 8 May 2003 19:51:22 -0700 (PDT) Received: from sleet.ispgateway.de (sleet.ispgateway.de [62.67.200.125]) by mx1.FreeBSD.org (Postfix) with SMTP id BFAD843F3F for ; Thu, 8 May 2003 19:51:18 -0700 (PDT) (envelope-from robert@spes.drehmel.com) Received: (qmail 21237 invoked from network); 9 May 2003 02:51:17 -0000 Received: from unknown (HELO spes.drehmel.com) (948464@[62.220.10.167]) (envelope-sender ) by sleet.ispgateway.de (qmail-ldap-1.03) with SMTP for ; 9 May 2003 02:51:17 -0000 Received: from spes.drehmel.com (localhost [127.0.0.1]) by spes.drehmel.com (8.12.9/8.12.6) with ESMTP id h492ob7Y002890; Fri, 9 May 2003 04:50:37 +0200 (CEST) (envelope-from robert@spes.drehmel.com) Received: (from robert@localhost) by spes.drehmel.com (8.12.9/8.12.6/Submit) id h492obGR002889; Fri, 9 May 2003 04:50:37 +0200 (CEST) Date: Fri, 9 May 2003 04:50:37 +0200 From: Robert Drehmel To: Marco Wertejuk Message-ID: <20030509025037.GA2691@spes.drehmel.com> References: <20030509011830.GA7306@maeko> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20030509011830.GA7306@maeko> User-Agent: Mutt/1.4i cc: freebsd-current@freebsd.org Subject: Re: sockstat dumps core X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 09 May 2003 02:51:22 -0000 Hello Marco, On Fri, May 09, 2003 at 03:18:30AM +0200, Marco Wertejuk wrote: > Hello, > > my current snapshot is from April 30th, and I've noticed > that sockstat -p 32768 dumps core. It does this for all > ports larger than 32767. > > Right now I don't have enough time for further investigations > but if other experience the same problem or anyone wants the > coredump, just tell me. the attached patch should fix it. ciao, -robert Index: sockstat.c =================================================================== RCS file: /data/FreeBSD-current_repo/src/usr.bin/sockstat/sockstat.c,v retrieving revision 1.6 diff -u -r1.6 sockstat.c --- sockstat.c 13 Jan 2003 00:28:56 -0000 1.6 +++ sockstat.c 9 May 2003 02:47:36 -0000 @@ -111,7 +111,7 @@ int port, end; if (ports == NULL) - if ((ports = calloc(1, 65536 / INT_BIT)) == NULL) + if ((ports = calloc(65536 / INT_BIT, sizeof(int))) == NULL) err(1, "calloc()"); p = portspec; while (*p != '\0') {