From: Jay Freeman (saurik) Date: Tue, 8 Jul 2014 12:58:10 +0000 (-0700) Subject: Corrupt load command should break for, not return. X-Git-Tag: v0.9.502~9 X-Git-Url: https://git.saurik.com/cycript.git/commitdiff_plain/48d5b4e3655d11f1de7a42b8a04fcad8cfc2e0a4 Corrupt load command should break for, not return. --- diff --git a/Trampoline.t.cpp b/Trampoline.t.cpp index 4ebf820..ab821e8 100644 --- a/Trampoline.t.cpp +++ b/Trampoline.t.cpp @@ -108,11 +108,11 @@ static const uint32_t MH_MAGIC_XX = MH_MAGIC; lcp->cmdsize % sizeof(long) != 0 || lcp->cmdsize <= 0 || \ reinterpret_cast(lcp) + lcp->cmdsize > reinterpret_cast(load_commands) + mach->sizeofcmds \ ) \ - return NULL; \ + break; \ else if (lcp->cmd != lc) \ continue; \ else if (lcp->cmdsize < sizeof(type)) \ - return NULL; \ + break; \ else if (const type *command = reinterpret_cast(lcp)) static const mach_header_xx *Library(struct dyld_all_image_infos *infos, const char *name) {