• Show log

    Commit

  • Hash : 880842cf
    Author : Sam Lantinga
    Date : 2016-12-31T16:14:51

    Fixed bug 3531 - internal SDL_vsnprintf implementation access memory outside given buffer ranges Tristan The internal SDL_vsnprintf implementation accesses memory outside buffer. The bug existed also inside the format (%) processing, which was fixed with Bug 3441. But there is still an invalid access, if we do not have any format inside the source string and the destination string is shorter than the format string. You can use any string for this test, as long it is longer than the buffer. Example: va_list argList; char buffer[4]; SDL_vsnprintf(buffer, sizeof(buffer), "Testing", argList); The bug is located on the 'else' branch of the format char test: while (*fmt) { if (*fmt == '%') { ... } else { if (left > 1) { *text = *fmt; --left; } ++fmt; ++text; } } if (left > 0) { *text = '\0'; } As you can see that text is always incremented, even when left is already one. When then on the last lines, *text is assigned the NULL char, the pointer is located outside bounds.

  • Properties

  • Git HTTP https://git.kmx.io/kc3-lang/SDL.git
    Git SSH git@git.kmx.io:kc3-lang/SDL.git
    Public access ? public
    Description

    Fork of https://github.com/libsdl-org/SDL

    Users
    thodg_w thodg_m thodg_l kc3_lang_org thodg www_kmx_io
    Tags

  • README.txt

  •                          Simple DirectMedia Layer
    
                                      (SDL)
    
                                    Version 2.0
    
    ---
    http://www.libsdl.org/
    
    Simple DirectMedia Layer is a cross-platform development library designed
    to provide low level access to audio, keyboard, mouse, joystick, and graphics
    hardware via OpenGL and Direct3D. It is used by video playback software,
    emulators, and popular games including Valve's award winning catalog
    and many Humble Bundle games.
    
    More extensive documentation is available in the docs directory, starting
    with README.md
    
    Enjoy!
    	Sam Lantinga				(slouken@libsdl.org)