sdl2_frt/src
Sam Lantinga f465f24d73 Fixed bug 3760 - RWops doesn't check for integer overflow when stdio_fseek only supports 32 bits
Simon Hug

When RWops seeks with fseek or fseeko it uses the types long or off_t which can be 32 bits on some platforms. stdio_seek does not check if the 64-bit integer for the offset fits into a 32-bit integer. Offsets equal or larger than 2 GiB will have implementation-defined behavior and failure states would be very confusing to debug.

The attached patch adds range checking by using the macros from limits.h for long type and some bit shifting for off_t because POSIX couldn't be bothered to specify min and max macros.

It also defines HAVE_FSEEKI64 in SDL_config_windows.h so that the Windows function gets picked up automatically with the default config.

And there's an additional error message for when ftell fails.
2017-09-09 08:36:37 -07:00
..
atomic Add atomics for Watcom/x86 as inline asm 2017-08-18 16:35:55 -04:00
audio wave: SDL_LoadWAV now supports 24-bit audio. 2017-09-07 10:56:08 -04:00
core Fixed compile warning 2017-08-28 14:45:19 -07:00
cpuinfo SDL_cpuinfo.c: add os/2 support to SDL_GetCPUCount() and SDL_GetSystemRAM(). 2017-08-21 13:00:40 -07:00
dynapi vulkan: use "unsigned int" instead of "unsigned" 2017-09-06 19:35:36 -04:00
events Fixed mingw Windows build, since SDL_vulkan_internal.h includes windows.h 2017-08-28 00:43:14 -07:00
file Fixed bug 3760 - RWops doesn't check for integer overflow when stdio_fseek only supports 32 bits 2017-09-09 08:36:37 -07:00
filesystem filesystem: Patched to compile on QNX. 2017-08-17 03:22:44 -04:00
haptic Renaming of guard header names to quiet -Wreserved-id-macro 2017-08-28 00:22:23 -07:00
joystick keep joystick thread from waking unnecessarily, and from possibly blocking for 300ms at shutdown if a joystick was just plugged in 2017-09-08 07:15:47 -07:00
libm Updated copyright for 2017 2017-01-01 18:33:28 -08:00
loadso Updated copyright for 2017 2017-01-01 18:33:28 -08:00
main Removed the need for libSDL2main.a on Android, and separated JNI initialization out for other integrations 2017-08-28 14:34:15 -07:00
power power: whoops, that should be "==" not "!=". 2017-07-03 16:45:12 -04:00
render Fixed building SDL applications with Visual Studio and the clang toolset 2017-08-19 03:07:44 -07:00
stdlib Fixed 64-bit build warning 2017-09-08 15:08:03 -07:00
test Fixed bug 3806 - Fixes for MSVC compiler warnings 2017-09-08 18:26:25 -07:00
thread Renaming of guard header names to quiet -Wreserved-id-macro 2017-08-28 00:22:23 -07:00
timer Fixed bug 3745 - specify SDLCALL as the calling convention for API callbacks 2017-08-14 06:28:21 -07:00
video Fixed bug 3808 - fix a typo in SDL_stretch.c 2017-09-09 08:20:56 -07:00
SDL_assert_c.h Updated copyright for 2017 2017-01-01 18:33:28 -08:00
SDL_assert.c Fixed bug 3744 - missing SDLCALL in several functions 2017-08-13 21:06:52 -07:00
SDL_dataqueue.c Updated copyright for 2017 2017-01-01 18:33:28 -08:00
SDL_dataqueue.h Updated copyright for 2017 2017-01-01 18:33:28 -08:00
SDL_error_c.h Updated copyright for 2017 2017-01-01 18:33:28 -08:00
SDL_error.c Fixed bug 3696 - SDL_ShowMessageBox displays different error from intended 2017-07-10 17:16:12 -07:00
SDL_hints.c Updated copyright for 2017 2017-01-01 18:33:28 -08:00
SDL_internal.h Some patches to make SDL compile with armcc (ARM's C compiler). 2017-03-02 13:33:04 -05:00
SDL_log.c Fixed bug 3745 - specify SDLCALL as the calling convention for API callbacks 2017-08-14 06:28:21 -07:00
SDL.c Backing out broken change from previous commit. 2017-04-01 00:46:42 -04:00