diff options
author | Nikias Bassen | 2010-07-29 23:25:36 +0200 |
---|---|---|
committer | Martin Szulecki | 2010-10-04 00:30:40 +0200 |
commit | b6b2f911500c2e7d80dc14a148710986272da609 (patch) | |
tree | e494facf1538bd97fdaed482ba579f679895bf2c | |
parent | 1d20391e9cd664bdd78de1adf9abbbd57b10f544 (diff) | |
download | libimobiledevice-b6b2f911500c2e7d80dc14a148710986272da609.tar.gz libimobiledevice-b6b2f911500c2e7d80dc14a148710986272da609.tar.bz2 |
property_list_service: fix plist receiving on big endian machines
-rw-r--r-- | src/property_list_service.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/property_list_service.c b/src/property_list_service.c index 80b5f52..5c6d2bd 100644 --- a/src/property_list_service.c +++ b/src/property_list_service.c @@ -226,10 +226,10 @@ static property_list_service_error_t internal_plist_receive_timeout(property_lis debug_info("initial read failed!"); return PROPERTY_LIST_SERVICE_E_MUX_ERROR; } else { - if ((char)pktlen == 0) { /* prevent huge buffers */ + pktlen = GUINT32_FROM_BE(pktlen); + if (pktlen < (1 << 24)) { /* prevent huge buffers */ uint32_t curlen = 0; char *content = NULL; - pktlen = GUINT32_FROM_BE(pktlen); debug_info("%d bytes following", pktlen); content = (char*)malloc(pktlen); |