From f06eeb013b6371097dcc3bb41b1f80813e0cee23 Mon Sep 17 00:00:00 2001 From: "J?rgen P. Tjern?" Date: Thu, 5 Sep 2013 15:49:57 -0700 Subject: [PATCH] Fix to buffer overrun in SDL_JoystickGetGUIDString(). --- src/joystick/SDL_joystick.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/joystick/SDL_joystick.c b/src/joystick/SDL_joystick.c index 730939502f76f..805eb5e2ffec9 100644 --- a/src/joystick/SDL_joystick.c +++ b/src/joystick/SDL_joystick.c @@ -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 */