From faafec8be9633f71ba54d3ee9028a76db243b024 Mon Sep 17 00:00:00 2001 From: zhangbo Date: Mon, 6 Sep 2021 14:43:54 +0800 Subject: Fix get wrong app directory from zip/ipa when there are other directory, taking "OnDemandResources" for example --- src/ideviceinstaller.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src') diff --git a/src/ideviceinstaller.c b/src/ideviceinstaller.c index e5c36ef..33737b9 100644 --- a/src/ideviceinstaller.c +++ b/src/ideviceinstaller.c @@ -355,6 +355,12 @@ static int zip_get_app_directory(struct zip* zf, char** path) len = p - name + 1; + /* make sure app directory endwith .app */ + if (len < 12 || strncmp(p - 4, ".app", 4)) + { + continue; + } + if (path != NULL) { free(*path); *path = NULL; -- cgit v1.1-32-gdbae