]> git.saurik.com Git - cycript.git/blobdiff - Mach/Inject.cpp
Fix creepy "dump master.passwd to stderr" failure.
[cycript.git] / Mach / Inject.cpp
index 982ffe405964be894db3f19bffb327ce56fbbdef..6ca0378b85075411ac5d2d4591173b6c57003679 100644 (file)
@@ -20,7 +20,7 @@
 /* }}} */
 
 #include "TargetConditionals.h"
-#ifdef TARGET_OS_IPHONE
+#if TARGET_OS_IPHONE
 #undef __ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__
 #define __ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__ __IPHONE_5_0
 #endif
@@ -57,7 +57,7 @@ void InjectLibrary(pid_t pid) {
     memcpy(library, addr.dli_fname, flength);
     library[flength] = '\0';
     _assert(strcmp(library + flength - 6, ".dylib") == 0);
-#ifndef TARGET_OS_IPHONE
+#if !TARGET_OS_IPHONE
     strcpy(library + flength - 6, "-any.dylib");
 #endif
 
@@ -207,6 +207,7 @@ void InjectLibrary(pid_t pid) {
 
     baton->dyld = info.all_image_info_addr;
     baton->pid = getpid();
+    memset(baton->error, 0, sizeof(baton->error));
     memcpy(baton->library, library, length);
 
     mach_vm_size_t size(depth + Stack_);