mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-10-16 14:56:00 +00:00
Fix to buffer overrun in SDL_JoystickGetGUIDString().
This commit is contained in:
@@ -776,7 +776,7 @@ void SDL_JoystickGetGUIDString( SDL_JoystickGUID guid, char *pszGUID, int cbGUID
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
for ( i = 0; i < sizeof(guid.data) && i < (cbGUID-1); i++ )
|
for ( i = 0; i < sizeof(guid.data) && i < (cbGUID-1)/2; i++ )
|
||||||
{
|
{
|
||||||
/* each input byte writes 2 ascii chars, and might write a null byte. */
|
/* each input byte writes 2 ascii chars, and might write a null byte. */
|
||||||
/* If we don't have room for next input byte, stop */
|
/* If we don't have room for next input byte, stop */
|
||||||
|
Reference in New Issue
Block a user