From 48d5b4e3655d11f1de7a42b8a04fcad8cfc2e0a4 Mon Sep 17 00:00:00 2001 From: "Jay Freeman (saurik)" Date: Tue, 8 Jul 2014 05:58:10 -0700 Subject: [PATCH] Corrupt load command should break for, not return. --- Trampoline.t.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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) { -- 2.49.0