Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 28 Mar 2002 12:41:56 -0500 (EST)
From:      Joe Marcus Clarke <marcus@marcuscom.com>
To:        FreeBSD-gnats-submit@FreeBSD.org
Subject:   ports/36426: [PATCH] Fix theme-switcher malloc abort on -CURRENT
Message-ID:  <200203281741.g2SHfuMu093217@jclarke-pc.cisco.com>

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

>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




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