Bug 136973

Summary: devel/sdl12 dumps core on 8-current when joystick is used
Product: Ports & Packages Reporter: Wes Morgan <morganw>
Component: Individual Port(s)Assignee: Marcus von Appen <mva>
Status: Closed FIXED    
Severity: Affects Only Me    
Priority: Normal    
Version: Latest   
Hardware: Any   
OS: Any   
Attachments:
Description Flags
file.diff none

Description Wes Morgan 2009-07-22 02:50:00 UTC
When attempting to use a joystick in an SDL application (such as dosbox), the program crashes. This seems to be due to an incorrect patch that leaves the "struct report" pointer uninitialized.

Fix: Correctly initialize the "rep" variable.

Patch attached with submission follows:
How-To-Repeat: Build and install dosbox on 8-current, attempt to use a (usb) joystick.
Comment 1 Mark Linimon freebsd_committer freebsd_triage 2009-07-22 02:58:31 UTC
Responsible Changed
From-To: freebsd-ports-bugs->mva

Fix synopsis and assign.
Comment 2 Marcus von Appen freebsd_committer freebsd_triage 2009-08-04 21:17:21 UTC
Hi,

I can't find any notable difference between your patch and the already
existing one within the ports. Did you send the wrong file around or am
I missing something?

Thanks and regards
Marcus
Comment 3 Wes Morgan 2009-08-05 04:52:02 UTC
On Tue, 4 Aug 2009, Marcus von Appen wrote:

> Hi,
>
> I can't find any notable difference between your patch and the already
> existing one within the ports. Did you send the wrong file around or am
> I missing something?
>
> Thanks and regards
> Marcus
>

The line with the rep assignment:

 	rep = &hw->inreport;

Needs to be before the #if conditionals, otherwise you'll dereference an 
uninitialized pointer. The patch in ports CVS has the assignment after the 
ifdef, instead of before.
Comment 4 dfilter service freebsd_committer freebsd_triage 2009-08-08 09:49:41 UTC
mva         2009-08-08 08:49:29 UTC

  FreeBSD ports repository

  Modified files:
    devel/sdl12          Makefile 
    devel/sdl12/files    patch-src_joystick_bsd_SDL_sysjoystick.c 
  Log:
  Fix crashes when joysticks are attached on -CURRENT.
  
  PR:             ports/136973
  Reviewed by:    Wes Morgan <morganw@chemikals.org>
  Approved by:    miwi (mentor)
  
  Revision  Changes    Path
  1.120     +1 -1      ports/devel/sdl12/Makefile
  1.2       +3 -3      ports/devel/sdl12/files/patch-src_joystick_bsd_SDL_sysjoystick.c
_______________________________________________
cvs-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/cvs-all
To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"
Comment 5 Marcus von Appen freebsd_committer freebsd_triage 2009-08-08 09:51:03 UTC
State Changed
From-To: open->closed

Committed. Thanks!