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 1802

Summary: NULL pointer dereference in SDL_AllocRW() if out of memory.
Product: SDL Reporter: Philipp Wiesemann <philipp.wiesemann>
Component: fileAssignee: Sam Lantinga <slouken>
Status: RESOLVED FIXED QA Contact: Sam Lantinga <slouken>
Severity: normal    
Priority: P2    
Version: HG 2.0   
Hardware: All   
OS: All   

Description Philipp Wiesemann 2013-04-14 05:30:56 UTC
There is a NULL pointer dereference in SDL_AllocRW() if the system is out of memory. The "type" field is always written. This may be fixed with an early return.

Or an else{} or not writing the field and using slower SDL_calloc().

This fault was recently introduced (http://hg.libsdl.org/SDL/rev/681820ca0e78).
Comment 1 Sam Lantinga 2013-04-17 04:32:36 UTC
Fixed, thanks!
http://hg.libsdl.org/SDL/rev/65df21723f58