SDL/include
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
..
begin_code.h Fixed bug 3807 - Remove restriction from DECLSPEC macro for OS/2 2017-09-09 07:42:29 -07:00
close_code.h Fixed bug 3781 - unbalanced #pragma pack(pop) in close_code.h 2017-08-28 09:41:00 -07:00
SDL_assert.h Watcom supports __FUNCTION__ identifier (and surely not __PRETTY_FUNCTION__) 2017-08-17 21:35:46 -04:00
SDL_atomic.h Fixed building SDL applications with Visual Studio and the clang toolset 2017-08-19 03:07:44 -07:00
SDL_audio.h Updated documentation, you don't need to initialize the audio subsystem to do in-place format conversion. (Thanks Simon Hug!) 2017-08-29 09:02:04 -07:00
SDL_bits.h Fixed bug 3791 - SDL_bits.h: __builtin_clz is supported in gcc >= 3.4 2017-08-31 15:17:59 -07:00
SDL_blendmode.h Fixed compiler warning with enum 2017-08-14 10:14:07 -07:00
SDL_clipboard.h Updated copyright for 2017 2017-01-01 18:33:28 -08:00
SDL_config_android.h 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
SDL_config_iphoneos.h 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
SDL_config_macosx.h 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
SDL_config_minimal.h Updated config headers to override the base SDL_config.h if both are included 2017-02-20 10:55:33 -08:00
SDL_config_pandora.h 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
SDL_config_psp.h 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
SDL_config_windows.h 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
SDL_config_winrt.h 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
SDL_config_wiz.h 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
SDL_config.h mistake: Revert the files that I did not mean to commit 2017-03-01 15:05:54 -08:00
SDL_config.h.cmake 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
SDL_config.h.in 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
SDL_copying.h Updated copyright for 2017 2017-01-01 18:33:28 -08:00
SDL_cpuinfo.h Fixed building SDL applications with Visual Studio and the clang toolset 2017-08-19 03:07:44 -07:00
SDL_egl.h Fixed bug 3724 - Allow Angle Static Link 2017-08-27 19:05:57 -07:00
SDL_endian.h SDL_endian.h: add SDL_Swap16 and SDL_Swap32 for Watcom/x86 as inline asm 2017-08-17 21:32:00 -04:00
SDL_error.h Updated copyright for 2017 2017-01-01 18:33:28 -08:00
SDL_events.h Fixed bug 2263 - Event timestamp members are undocumented 2017-08-14 21:40:40 -07:00
SDL_filesystem.h Updated copyright for 2017 2017-01-01 18:33:28 -08:00
SDL_gamecontroller.h Updated copyright for 2017 2017-01-01 18:33:28 -08:00
SDL_gesture.h Updated copyright for 2017 2017-01-01 18:33:28 -08:00
SDL_haptic.h Fixed typos and documentation in haptic header file. 2017-04-02 21:32:49 +02:00
SDL_hints.h Fixed bug 3745 - specify SDLCALL as the calling convention for API callbacks 2017-08-14 06:28:21 -07:00
SDL_joystick.h Added an API to get the joystick instance ID before opening the device: SDL_JoystickGetDeviceInstanceID() 2017-03-09 16:09:16 -08:00
SDL_keyboard.h Updated copyright for 2017 2017-01-01 18:33:28 -08:00
SDL_keycode.h Added a note about number key keycodes always being SDLK_0...SDLK_9 even on AZERTY layouts 2017-08-12 15:45:46 -07:00
SDL_loadso.h Updated copyright for 2017 2017-01-01 18:33:28 -08:00
SDL_log.h Fixed bug 3745 - specify SDLCALL as the calling convention for API callbacks 2017-08-14 06:28:21 -07:00
SDL_main.h Removed the need for libSDL2main.a on Android, and separated JNI initialization out for other integrations 2017-08-28 14:34:15 -07:00
SDL_messagebox.h Updated copyright for 2017 2017-01-01 18:33:28 -08:00
SDL_mouse.h Fixed comments in headers for doxygen output. 2017-06-04 23:15:39 +02:00
SDL_mutex.h Updated copyright for 2017 2017-01-01 18:33:28 -08:00
SDL_name.h Updated copyright for 2017 2017-01-01 18:33:28 -08:00
SDL_opengl_glext.h Fixed crash if initialization of EGL failed but was tried again later. 2015-06-21 17:33:46 +02:00
SDL_opengl.h add missing os/2 apientry defs to SDL_opengl.h 2017-08-19 11:15:58 -07:00
SDL_opengles2_gl2.h Fixed crash if initialization of EGL failed but was tried again later. 2015-06-21 17:33:46 +02:00
SDL_opengles2_gl2ext.h Fixed crash if initialization of EGL failed but was tried again later. 2015-06-21 17:33:46 +02:00
SDL_opengles2_gl2platform.h Fixed crash if initialization of EGL failed but was tried again later. 2015-06-21 17:33:46 +02:00
SDL_opengles2_khrplatform.h Fixed crash if initialization of EGL failed but was tried again later. 2015-06-21 17:33:46 +02:00
SDL_opengles2.h Updated copyright for 2017 2017-01-01 18:33:28 -08:00
SDL_opengles.h Updated copyright for 2017 2017-01-01 18:33:28 -08:00
SDL_pixels.h Updated copyright for 2017 2017-01-01 18:33:28 -08:00
SDL_platform.h Fixed building with the first version of Visual Studio 2017, which doesn't have __has_include() (Thanks Simon!) 2017-09-08 15:08:50 -07:00
SDL_power.h Updated copyright for 2017 2017-01-01 18:33:28 -08:00
SDL_quit.h Updated copyright for 2017 2017-01-01 18:33:28 -08:00
SDL_rect.h Updated copyright for 2017 2017-01-01 18:33:28 -08:00
SDL_render.h Note that texture contents are undefined when the texture is created. 2017-08-12 13:05:26 -07:00
SDL_revision.h mistake: Revert the files that I did not mean to commit 2017-03-01 15:05:54 -08:00
SDL_rwops.h Added an API SDL_LoadFile_RW() to load all the data from an SDL data stream, and a convenience macro SDL_LoadFile() to load all the data from a file. 2017-08-09 11:58:38 -07:00
SDL_scancode.h Fixed bug 3703 - Missing media keys support on Amazon Fire TV remote control 2017-07-20 10:46:38 -07:00
SDL_shape.h Fixed typos in shape header. 2017-07-29 23:00:54 +02:00
SDL_stdinc.h Fixed bug 3780 - GCC 7 implicit fallthrough warnings 2017-09-06 04:32:30 -07:00
SDL_surface.h Fixed bug 2441 - SDL_DuplicateSurface 2017-08-14 13:37:14 -07:00
SDL_system.h Updated copyright for 2017 2017-01-01 18:33:28 -08:00
SDL_syswm.h Fixed bug 3752 - minor os2 defines 2017-08-14 10:15:38 -07:00
SDL_test_assert.h Updated copyright for 2017 2017-01-01 18:33:28 -08:00
SDL_test_common.h Updated copyright for 2017 2017-01-01 18:33:28 -08:00
SDL_test_compare.h Updated copyright for 2017 2017-01-01 18:33:28 -08:00
SDL_test_crc32.h Updated copyright for 2017 2017-01-01 18:33:28 -08:00
SDL_test_font.h We don't need to pass the renderer into SDLTest_CleanupTextDrawing() 2017-09-08 04:53:31 -07:00
SDL_test_fuzzer.h Updated copyright for 2017 2017-01-01 18:33:28 -08:00
SDL_test_harness.h Updated copyright for 2017 2017-01-01 18:33:28 -08:00
SDL_test_images.h Updated copyright for 2017 2017-01-01 18:33:28 -08:00
SDL_test_log.h Updated copyright for 2017 2017-01-01 18:33:28 -08:00
SDL_test_md5.h Updated copyright for 2017 2017-01-01 18:33:28 -08:00
SDL_test_random.h Updated copyright for 2017 2017-01-01 18:33:28 -08:00
SDL_test.h Updated copyright for 2017 2017-01-01 18:33:28 -08:00
SDL_thread.h SDL_thread.h: fix os/2 defines (rev 11340:2688d85b817c was a missing patch) 2017-08-27 18:48:51 -07:00
SDL_timer.h Updated copyright for 2017 2017-01-01 18:33:28 -08:00
SDL_touch.h Updated copyright for 2017 2017-01-01 18:33:28 -08:00
SDL_types.h Updated copyright for 2017 2017-01-01 18:33:28 -08:00
SDL_version.h Updated version to 2.0.6 2017-08-18 18:16:37 -07:00
SDL_video.h vulkan: Changed SDL_WINDOW_VULKAN value to match Tizen's fork. 2017-09-03 13:20:33 -04:00
SDL_vulkan.h vulkan: use "unsigned int" instead of "unsigned" 2017-09-06 19:35:36 -04:00
SDL.h Fixed typedef redefinition errors when including both SDL_vulkan.h and vulkan.h 2017-08-27 23:13:15 -07:00