From owner-freebsd-ports Thu Mar 28 11:10:38 2002 Delivered-To: freebsd-ports@hub.freebsd.org Received: from freefall.freebsd.org (freefall.FreeBSD.org [216.136.204.21]) by hub.freebsd.org (Postfix) with ESMTP id C10BD37B419 for ; Thu, 28 Mar 2002 11:10:01 -0800 (PST) Received: (from gnats@localhost) by freefall.freebsd.org (8.11.6/8.11.6) id g2SJA1o66866; Thu, 28 Mar 2002 11:10:01 -0800 (PST) (envelope-from gnats) Received: from rooster.cisco.com (rooster.cisco.com [64.102.19.200]) by hub.freebsd.org (Postfix) with ESMTP id 2CE6737B405 for ; Thu, 28 Mar 2002 11:07:53 -0800 (PST) Received: from jclarke-pc.cisco.com (jclarke-pc.cisco.com [172.18.123.230]) by rooster.cisco.com (8.8.8+Sun/8.8.8) with ESMTP id OAA07474 for ; Thu, 28 Mar 2002 14:07:52 -0500 (EST) Received: from jclarke-pc.cisco.com (localhost.cisco.com [127.0.0.1]) by jclarke-pc.cisco.com (8.12.2/8.12.2) with ESMTP id g2SHfuol093218 for ; Thu, 28 Mar 2002 12:41:56 -0500 (EST) (envelope-from marcus@jclarke-pc.cisco.com) Received: (from marcus@localhost) by jclarke-pc.cisco.com (8.12.2/8.12.2/Submit) id g2SHfuMu093217; Thu, 28 Mar 2002 12:41:56 -0500 (EST) Message-Id: <200203281741.g2SHfuMu093217@jclarke-pc.cisco.com> Date: Thu, 28 Mar 2002 12:41:56 -0500 (EST) From: Joe Marcus Clarke Reply-To: Joe Marcus Clarke To: FreeBSD-gnats-submit@FreeBSD.org X-Send-Pr-Version: 3.113 Subject: ports/36426: [PATCH] Fix theme-switcher malloc abort on -CURRENT Sender: owner-freebsd-ports@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org >Number: 36426 >Category: ports >Synopsis: [PATCH] Fix theme-switcher malloc abort on -CURRENT >Confidential: no >Severity: non-critical >Priority: medium >Responsible: freebsd-ports >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Thu Mar 28 11:10:01 PST 2002 >Closed-Date: >Last-Modified: >Originator: Joe Marcus Clarke >Release: FreeBSD 5.0-CURRENT i386 >Organization: MarcusCom, Inc. >Environment: System: FreeBSD jclarke-pc.cisco.com 5.0-CURRENT FreeBSD 5.0-CURRENT #0: Wed Mar 27 17:38:29 EST 2002 root@jclarke-pc.cisco.com:/usr/obj/usr/src/sys/JCLARKE-PC i386 >Description: On -CURRENT, the theme-switcher-capplet will core dump with an abort trap due to a bad free() of a static allocated array. This patch fixes this problem by using malloc() to allocate lineptr instead of using static memory. Another way to fix this is to simply remove the call to free(lineptr). >How-To-Repeat: Try to select a new theme on -CURRENT. >Fix: --- patch-capplets::theme-switcher::lister.c begins here --- --- capplets/theme-switcher/lister.c.orig Thu Mar 28 12:25:27 2002 +++ capplets/theme-switcher/lister.c Thu Mar 28 12:30:36 2002 @@ -115,8 +115,7 @@ char *errstring = NULL; int out_fd; #ifndef HAVE_GETLINE - char line[1024]; - char *lineptr = line; + char *lineptr = (char *)malloc(1024); #else char *lineptr = NULL; #endif --- patch-capplets::theme-switcher::lister.c ends here --- >Release-Note: >Audit-Trail: >Unformatted: To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-ports" in the body of the message