-
Notifications
You must be signed in to change notification settings - Fork 72
[GEN][ZH] Fix several potential buffer overruns in game code #849
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…, GetTimeFormatW and FormatMessageW.
Generals/Code/GameEngine/Source/Common/System/SaveGame/GameState.cpp
Outdated
Show resolved
Hide resolved
Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/PopupReplay.cpp
Outdated
Show resolved
Hide resolved
@@ -235,7 +235,7 @@ void W3DMouse::initD3DAssets(void) | |||
for (Int j=0; j < MAX_2D_CURSOR_ANIM_FRAMES; j++) | |||
{ | |||
cursorTextures[i][j]=NULL;//am->Get_Texture(m_cursorInfo[i].textureName.str()); | |||
m_currentD3DSurface[i]=NULL; | |||
m_currentD3DSurface[j]=NULL; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The double loop is not the correct location to write to this member.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed, it was a compromise in order to keep the diff as minimal as possible. Went with a separate loop for clearing m_current_D3DSurface instead.
Does any of these changes fix an observable bug in the game? |
Not that I know of, but I'm unfortunately not familiar enough with the set of known bugs either to tell. The issues were identified with the MSVC static code analysis and some manual check to see if it seemed plausible or not, so it's approaching from a bit of a different angle than a known repro. |
This PR addresses some buffer size issues that had the potential of writing beyond the bounds.