From 9a380d23e5c45c30509631401a35a71414377656 Mon Sep 17 00:00:00 2001 From: Martin Szulecki Date: Mon, 21 Mar 2011 16:17:45 +0100 Subject: 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. --- src/property_list_service.c | 5 +++++ 1 file changed, 5 insertions(+) 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) { -- cgit v1.1-32-gdbae