summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Martin Szulecki2011-03-21 16:17:45 +0100
committerGravatar Martin Szulecki2011-03-21 16:17:45 +0100
commit9a380d23e5c45c30509631401a35a71414377656 (patch)
treee7dff88ceaaa7df3e0420f26173bd3b5e30eb23d
parent74f050c286e6957294a15c86c5f739f49041b6cb (diff)
downloadlibimobiledevice-9a380d23e5c45c30509631401a35a71414377656.tar.gz
libimobiledevice-9a380d23e5c45c30509631401a35a71414377656.tar.bz2
Due to a bug in iOS 4.3, plist data might contain invalid null characters
The main lockdown plist of iOS 4.3 contains invalid null characters which we now convert to spaces. Fixes running ideviceinfo on iOS 4.3. Thanks to teuf for debugging and proposing the fix.
-rw-r--r--src/property_list_service.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/property_list_service.c b/src/property_list_service.c
index 5c6d2bd..8af958e 100644
--- a/src/property_list_service.c
+++ b/src/property_list_service.c
@@ -245,6 +245,11 @@ static property_list_service_error_t internal_plist_receive_timeout(property_lis
if (!memcmp(content, "bplist00", 8)) {
plist_from_bin(content, pktlen, plist);
} else {
+ /* iOS 4.3 hack: plist data might contain invalid null characters, thus we convert those to spaces */
+ for (bytes = 0; bytes < pktlen-1; bytes++) {
+ if (content[bytes] == 0x0)
+ content[bytes] = 0x20;
+ }
plist_from_xml(content, pktlen, plist);
}
if (*plist) {