We are currently migrating Bugzilla to GitHub issues.
Any changes made to the bug tracker now will be lost, so please do not post new bugs or make changes to them.
When we're done, all bug URLs will redirect to their equivalent location on the new bug tracker.

Bug 1530 - X11 touch initialisation does not check its file handles
Summary: X11 touch initialisation does not check its file handles
Status: RESOLVED FIXED
Alias: None
Product: SDL
Classification: Unclassified
Component: video (show other bugs)
Version: HG 2.0
Hardware: All FreeBSD
: P2 critical
Assignee: Sam Lantinga
QA Contact: Sam Lantinga
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-06-27 23:58 UTC by Marcus von Appen
Modified: 2012-07-02 05:33 UTC (History)
0 users

See Also:


Attachments
NULL pointer fix for X11_InitTouch() (334 bytes, patch)
2012-06-27 23:58 UTC, Marcus von Appen
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Marcus von Appen 2012-06-27 23:58:11 UTC
Created attachment 891 [details]
NULL pointer fix for X11_InitTouch()

On X11 a NULL pointer SIGSEGV might occur on call X11_InitTouch, if the user
has only limited access to /proc or if /proc is not mounted for whatever reason:

#0  0x000000080107d88b in flockfile () from /lib/libc.so.7
#1  0x0000000800fee6e3 in feof () from /lib/libc.so.7
#2  0x0000000804310a58 in X11_InitTouch (_this=0x8016d7800)
    at ../src/video/x11/SDL_x11touch.c:55
#3  0x00000008043114ad in X11_VideoInit (_this=0x8016d7800)
    at ../src/video/x11/SDL_x11video.c:371
#4  0x00000008042f9b9a in SDL_VideoInit (driver_name=0x0)

It must be ensured that the return value of fopen("/proc/....") is not NULL.
Comment 1 Sam Lantinga 2012-07-02 05:33:47 UTC
Fixed, thanks!
http://hg.libsdl.org/SDL/rev/049721824c2e