summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorGravatar Christophe Fergeau2012-06-26 00:03:30 +0200
committerGravatar Nikias Bassen2012-06-26 00:03:30 +0200
commit060e3f2683ed2b0b08e1a31deb9608a99e193b4a (patch)
tree1e56afb89d41e86eb94f5952b677f14887d290e5 /src
parent849ea066426b8f5f6e6d1aea9804e095edca3b49 (diff)
downloadlibimobiledevice-060e3f2683ed2b0b08e1a31deb9608a99e193b4a.tar.gz
libimobiledevice-060e3f2683ed2b0b08e1a31deb9608a99e193b4a.tar.bz2
property_list_service: do not strip non-ASCII characters from XML plists
'content' is declared as char content[] so if char is signed, all characters with the high bit set will be negative so they will be < 0x20. This means the code will strip all non-ASCII (multi-byte) UTF-8 characters and replace them with spaces. This commit fixes it now by really only considering ASCII characters.
Diffstat (limited to 'src')
-rw-r--r--src/property_list_service.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/property_list_service.c b/src/property_list_service.c
index 8634864..c9a8edf 100644
--- a/src/property_list_service.c
+++ b/src/property_list_service.c
@@ -250,7 +250,7 @@ static property_list_service_error_t internal_plist_receive_timeout(property_lis
} else {
/* iOS 4.3+ hack: plist data might contain invalid characters, thus we convert those to spaces */
for (bytes = 0; bytes < pktlen-1; bytes++) {
- if ((content[bytes] < 0x20) && (content[bytes] != 0x09) && (content[bytes] != 0x0a) && (content[bytes] != 0x0d))
+ if ((content[bytes] >= 0) && (content[bytes] < 0x20) && (content[bytes] != 0x09) && (content[bytes] != 0x0a) && (content[bytes] != 0x0d))
content[bytes] = 0x20;
}
plist_from_xml(content, pktlen, plist);