Skip to content

Commit

Permalink
Fix to buffer overrun in SDL_JoystickGetGUIDString().
Browse files Browse the repository at this point in the history
  • Loading branch information
jorgenpt committed Sep 5, 2013
1 parent 4b942c5 commit f06eeb0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/joystick/SDL_joystick.c
Expand Up @@ -776,7 +776,7 @@ void SDL_JoystickGetGUIDString( SDL_JoystickGUID guid, char *pszGUID, int cbGUID
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. */
/* If we don't have room for next input byte, stop */
Expand Down

0 comments on commit f06eeb0

Please sign in to comment.