Ronald Oussoren avatar Ronald Oussoren committed 45f31e5

Fix for issue #5: posssible stack overflow in py2app/apptemplate/src/main.c

Comments (0)

Files changed (10)

doc/changelog.rst

 
 - Don't drop into PDB when an exception occurs.
 
+- Issue #5: Avoid a possible stack overflow in the bundle executable
+
 py2app 0.5.2
 ------------
 
Add a comment to this file

py2app/apptemplate/prebuilt/main-fat

Binary file modified.

Add a comment to this file

py2app/apptemplate/prebuilt/main-fat3

Binary file modified.

Add a comment to this file

py2app/apptemplate/prebuilt/main-i386

Binary file modified.

Add a comment to this file

py2app/apptemplate/prebuilt/main-intel

Binary file modified.

Add a comment to this file

py2app/apptemplate/prebuilt/main-ppc

Binary file modified.

Add a comment to this file

py2app/apptemplate/prebuilt/main-ppc64

Binary file modified.

Add a comment to this file

py2app/apptemplate/prebuilt/main-universal

Binary file modified.

Add a comment to this file

py2app/apptemplate/prebuilt/main-x86_64

Binary file modified.

py2app/apptemplate/src/main.c

 }
 
 static void setExecutablePath(void) {
-    char executable_path[PATH_MAX];
+    char executable_path[PATH_MAX+1];
     uint32_t bufsize = PATH_MAX;
-    if (!_NSGetExecutablePath(executable_path, &bufsize)) {
-        executable_path[bufsize] = '\0';
+    memset(executable_path, '\0', PATH_MAX+1);
+    if (_NSGetExecutablePath(executable_path, &bufsize) == 0) {
         setenv("EXECUTABLEPATH", executable_path, 1);
     }
 }
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.