Fix overflow when doing SDL_sscanf("%hd", ...)
An overflow occured in the stdlib_sscanf test, when using msys2 clang32 toolchain. (cherry picked from commit342ec51131) (cherry picked from commit10135b2d7b)
This commit is contained in:
1 parent
739d3ec189
commit
5bfdb6e02f
1 file changed
+3
-1
@@ -1190,7 +1190,9 @@ int SDL_vsscanf(const char *text, const char *fmt, va_list ap)
|
|||||||
suppress = SDL_TRUE;
|
suppress = SDL_TRUE;
|
||||||
break;
|
break;
|
||||||
case 'h':
|
case 'h':
|
||||||
if (inttype > DO_SHORT) {
|
if (inttype == DO_INT) {
|
||||||
|
inttype = DO_SHORT;
|
||||||
|
} else if (inttype > DO_SHORT) {
|
||||||
++inttype;
|
++inttype;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|||||||
Reference in new issue
Block a user