Commit 609b58e4417d0f9d0996943d1b97891587b4bd15

Ryan C. Gordon 2013-10-24T00:00:10

Fixed buffer overflow.

1
2
3
4
5
6
7
8
9
10
11
12
13
diff --git a/src/filesystem/cocoa/SDL_sysfilesystem.m b/src/filesystem/cocoa/SDL_sysfilesystem.m
index 760830a..587c35c 100644
--- a/src/filesystem/cocoa/SDL_sysfilesystem.m
+++ b/src/filesystem/cocoa/SDL_sysfilesystem.m
@@ -77,7 +77,7 @@ SDL_GetPrefPath(const char *org, const char *app)
         NSString *str = [array objectAtIndex:0];
         const char *base = [str fileSystemRepresentation];
         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);
             if (retval == NULL) {
                 SDL_OutOfMemory();