INSTALL.txt
author Sam Lantinga <slouken@libsdl.org>
Wed, 10 Jul 2013 21:57:31 -0700
changeset 7396 a36ab6149a10
parent 7227 74109eae3381
child 9025 d09d4b578e77
permissions -rw-r--r--
Fixed bug 1953 - Crash at memcpy X11_DispatchEvent(_THIS) Function Nitz In Function X11_DispatchEvent(_THIS), case SelectionNotify : static void X11_DispatchEvent(_THIS) { // Some Code case SelectionNotify: { //Some Code SDL_bool expect_lf = SDL_FALSE; char *start = NULL; // Initialised with NULL char *scan = (char*)p.data; char *fn; char *uri; int length = 0; while (p.count--) { if (!expect_lf) { if (*scan==0x0D) { expect_lf = SDL_TRUE; } else if(start == NULL) { start = scan; length = 0; } length++; } else { if (*scan==0x0A && length>0) { uri = malloc(length--); memcpy(uri, start, length); // Problem is Here, start is still NULL if control comes to else statement without initialising the start pointer, which is wrong uri[length] = 0; fn = X11_URIToLocal(uri); if (fn) SDL_SendDropFile(fn); free(uri); } expect_lf = SDL_FALSE; start = NULL; } scan++; } } As shown above how start pointer remains NULL, Patch for this issue would be: if (*scan==0x0D) { expect_lf = SDL_TRUE; } if(start == NULL) { start = scan; length = 0; } Just replace else if statement with if.


To compile and install SDL:

    1.  Windows with Visual Studio:
        * Read VisualC.html

        Windows with gcc, either native or cross-compiling:
        * Read the FAQ at http://wiki.libsdl.org/moin.fcg/FAQWindows
        * Run './configure; make; make install'

        Mac OS X with Xcode:
        * Read README-macosx.txt

        Mac OS X from the command line:
        * Run './configure; make; make install'

        Linux and other UNIX systems:
        * Run './configure; make; make install'

        Android:
        * Read README-android.txt

        iOS:
        * Read README-ios.txt

        Using Cmake:
        * Read README-cmake.txt

    2.  Look at the example programs in ./test, and check out the online
        documentation at http://wiki.libsdl.org/

    3.  Join the SDL developer mailing list by sending E-mail to
    	sdl-request@libsdl.org
        and put "subscribe" in the subject of the message.

        Or alternatively you can use the web interface:
            http://www.libsdl.org/mailing-list.php

That's it!
Sam Lantinga <slouken@libsdl.org>