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 4839 - Read of uninitialized memory in Win32_ResizeWindowShape
Summary: Read of uninitialized memory in Win32_ResizeWindowShape
Status: RESOLVED FIXED
Alias: None
Product: SDL
Classification: Unclassified
Component: video (show other bugs)
Version: 2.0.10
Hardware: All Windows (All)
: P2 normal
Assignee: Sam Lantinga
QA Contact: Sam Lantinga
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-10-21 11:26 UTC by Mathieu Eyraud
Modified: 2019-10-23 07:19 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Mathieu Eyraud 2019-10-21 11:26:39 UTC
In file src/video/windows/SDL_windowsshape.c ( https://hg.libsdl.org/SDL/file/74ac66d0e8ca/src/video/windows/SDL_windowsshape.c ):

Memory is allocated on line 32 by malloc in Win32_CreateShaper;
Member 'hasshape' is not initialized;
Calling Win32_ResizeWindowShape on line 41;
Win32_ResizeWindowShape read 'hasshape' on line 101.
Comment 1 Sylvain 2019-10-23 07:19:28 UTC
Thanks ! Fixed in https://hg.libsdl.org/SDL/rev/c6296591b16f

( the way it would be initialized afterwards https://hg.libsdl.org/SDL/file/c6296591b16f/src/video/SDL_shape.c#l48 )