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 - NULL pointer dereference in SDL_AllocRW() if out of memory.
Summary: NULL pointer dereference in SDL_AllocRW() if out of memory.
Status: RESOLVED FIXED
Alias: None
Product: SDL
Classification: Unclassified
Component: file (show other bugs)
Version: HG 2.0
Hardware: All All
: P2 normal
Assignee: Sam Lantinga
QA Contact: Sam Lantinga
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-04-14 05:30 UTC by Philipp Wiesemann
Modified: 2013-04-17 04:32 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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