From owner-freebsd-ports-bugs@FreeBSD.ORG Sun Oct 31 15:30:32 2004 Return-Path: Delivered-To: freebsd-ports-bugs@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 2D7AE16A4CE for ; Sun, 31 Oct 2004 15:30:32 +0000 (GMT) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 032FF43D1F for ; Sun, 31 Oct 2004 15:30:32 +0000 (GMT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) i9VFUV05044119 for ; Sun, 31 Oct 2004 15:30:31 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.12.11/8.12.11/Submit) id i9VFUV5H044114; Sun, 31 Oct 2004 15:30:31 GMT (envelope-from gnats) Resent-Date: Sun, 31 Oct 2004 15:30:31 GMT Resent-Message-Id: <200410311530.i9VFUV5H044114@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, Alfred Perlstein Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id B35D816A4CE for ; Sun, 31 Oct 2004 15:27:21 +0000 (GMT) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id A5EDA43D31 for ; Sun, 31 Oct 2004 15:27:21 +0000 (GMT) (envelope-from alfred@FreeBSD.org) Received: from freefall.freebsd.org (alfred@localhost [127.0.0.1]) by freefall.freebsd.org (8.12.11/8.12.11) with ESMTP id i9VFRL31044049 for ; Sun, 31 Oct 2004 15:27:21 GMT (envelope-from alfred@freefall.freebsd.org) Received: (from alfred@localhost) by freefall.freebsd.org (8.12.11/8.12.11/Submit) id i9VFRLtk044048; Sun, 31 Oct 2004 15:27:21 GMT (envelope-from alfred) Message-Id: <200410311527.i9VFRLtk044048@freefall.freebsd.org> Date: Sun, 31 Oct 2004 15:27:21 GMT From: Alfred Perlstein To: FreeBSD-gnats-submit@FreeBSD.org X-Send-Pr-Version: 3.113 Subject: ports/73353: patch for ports/sdl12 malloc bug. X-BeenThere: freebsd-ports-bugs@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: Alfred Perlstein List-Id: Ports bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 31 Oct 2004 15:30:32 -0000 >Number: 73353 >Category: ports >Synopsis: patch for ports/sdl12 malloc bug. >Confidential: no >Severity: serious >Priority: high >Responsible: freebsd-ports-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Sun Oct 31 15:30:31 GMT 2004 >Closed-Date: >Last-Modified: >Originator: Alfred Perlstein >Release: FreeBSD 4.10-STABLE i386 >Organization: RED Inc >Environment: System: FreeBSD freefall.freebsd.org 4.10-STABLE FreeBSD 4.10-STABLE #13: Fri May 28 21:29:54 PDT 2004 kensmith@freefall.freebsd.org:/c/src/sys/compile/FREEFALL i386 >Description: If you don't have joysticks, then SDL will free(3) already free(3)'d memory and screw up the heap. David Xu pinned down a problem to this double/incorrect free(3). This patch I wrote seems to fix it. >How-To-Repeat: Run an SDL linked program under valgrind without any joysticks present in the system. >Fix: Index: files/patch-al =================================================================== RCS file: files/patch-al diff -N files/patch-al --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ files/patch-al 31 Oct 2004 15:10:31 -0000 @@ -0,0 +1,10 @@ +--- src/joystick/bsd/SDL_sysjoystick.c Wed Feb 18 09:22:01 2004 ++++ src/joystick/bsd/SDL_sysjoystick.c Sun Oct 31 06:55:00 2004 +@@ -160,6 +160,7 @@ + SDL_numjoysticks++; + } else { + free(joynames[nj.index]); ++ joynames[nj.index] = NULL; + } + } + for (i = 0; i < MAX_JOY_JOYS; i++) { >Release-Note: >Audit-Trail: >Unformatted: