diff --git a/RootHelper/main.m b/RootHelper/main.m index 9160b78..44e65a6 100644 --- a/RootHelper/main.m +++ b/RootHelper/main.m @@ -1169,7 +1169,7 @@ int uninstallAppByPath(NSString* appPath, BOOL useCustomMethod) NSString* standardizedAppPath = appPath.stringByStandardizingPath; - if(![standardizedAppPath hasPrefix:@"/var/containers/Bundle/Application/"] && standardizedAppPath.pathComponents.count == 5) + if(![standardizedAppPath hasPrefix:@"/var/containers/Bundle/Application/"] || standardizedAppPath.pathComponents.count < 5) { return 1; } diff --git a/RootHelper/unarchive.m b/RootHelper/unarchive.m index f62e09f..8e197aa 100644 --- a/RootHelper/unarchive.m +++ b/RootHelper/unarchive.m @@ -58,6 +58,12 @@ int extract(NSString* fileToExtract, NSString* extractionPath) return 1; NSString* currentFile = [NSString stringWithUTF8String:archive_entry_pathname(entry)]; + if (currentFile.length == 0) { + continue; + } + if ([currentFile hasPrefix:@"/"] || [currentFile containsString:@".."]) { + return 1; + } NSString* fullOutputPath = [extractionPath stringByAppendingPathComponent:currentFile]; //printf("extracting %@ to %@\n", currentFile, fullOutputPath); archive_entry_set_pathname(entry, fullOutputPath.fileSystemRepresentation);