[darwinbuild-changes] [974] branches/PR-10412066

source_changes at macosforge.org source_changes at macosforge.org
Thu Nov 10 13:15:00 PST 2011


Revision: 974
          http://trac.macosforge.org/projects/darwinbuild/changeset/974
Author:   kvv at apple.com
Date:     2011-11-10 13:14:58 -0800 (Thu, 10 Nov 2011)
Log Message:
-----------
- darwintrace: crash in darwintrace_make_environ

Modified Paths:
--------------
    branches/PR-10412066/CHANGES
    branches/PR-10412066/darwintrace/darwintrace.c

Modified: branches/PR-10412066/CHANGES
===================================================================
--- branches/PR-10412066/CHANGES	2011-11-09 22:53:31 UTC (rev 973)
+++ branches/PR-10412066/CHANGES	2011-11-10 21:14:58 UTC (rev 974)
@@ -1,5 +1,8 @@
 Darwin Build Scripts Change History
 -----------------------------------
+Release 26.x [9-Nov-2011]
+	- darwintrace: crash in darwintrace_make_environ
+
 Release 26.1 [7-Nov-2011]
 	- darwintrace: compiler warning build fix
 

Modified: branches/PR-10412066/darwintrace/darwintrace.c
===================================================================
--- branches/PR-10412066/darwintrace/darwintrace.c	2011-11-09 22:53:31 UTC (rev 973)
+++ branches/PR-10412066/darwintrace/darwintrace.c	2011-11-10 21:14:58 UTC (rev 974)
@@ -405,20 +405,22 @@
             result[i] = strdup(DARWINTRACE_PLACEHOLDER);
         }
         ++i;
-        
+
         if (darwintrace_dylib_path) {
-            int add_dylib = (strstr(libs, darwintrace_dylib_path) == NULL);
-            asprintf(&result[i],
-                     "%s%s%s%s",
-                     DYLD_INSERT_LIBRARIES,
-                     add_dylib ? darwintrace_dylib_path : "",
-                     (add_dylib && libs) ? ":" : "",
-                     libs ? libs : "");
+            if (libs && strstr(libs, darwintrace_dylib_path)) {
+                /* inserted libraries already contain dylib */
+                result[i] = strdup(DARWINTRACE_PLACEHOLDER);
+            } else {
+                /* otherwise set or insert the dylib path */
+                asprintf(&result[i], "%s%s%s%s",
+                        DYLD_INSERT_LIBRARIES, darwintrace_dylib_path,
+                        libs ? ":" : "", libs ? libs : "");
+            }
         } else {
             result[i] = strdup(DARWINTRACE_PLACEHOLDER);
         }
         ++i;
-        
+
         memcpy(&result[i], envp, count * sizeof(char *));
 
         while (result[i] != NULL) {
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/darwinbuild-changes/attachments/20111110/d2d2f861/attachment.html>


More information about the darwinbuild-changes mailing list