mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-10-12 12:55:59 +00:00
Fixed buffer overflow.
This commit is contained in:
@@ -77,7 +77,7 @@ SDL_GetPrefPath(const char *org, const char *app)
|
|||||||
NSString *str = [array objectAtIndex:0];
|
NSString *str = [array objectAtIndex:0];
|
||||||
const char *base = [str fileSystemRepresentation];
|
const char *base = [str fileSystemRepresentation];
|
||||||
if (base) {
|
if (base) {
|
||||||
const size_t len = SDL_strlen(base) + SDL_strlen(app) + 4;
|
const size_t len = SDL_strlen(base) + SDL_strlen(org) + SDL_strlen(app) + 4;
|
||||||
retval = (char *) SDL_malloc(len);
|
retval = (char *) SDL_malloc(len);
|
||||||
if (retval == NULL) {
|
if (retval == NULL) {
|
||||||
SDL_OutOfMemory();
|
SDL_OutOfMemory();
|
||||||
|
Reference in New Issue
Block a user