diff options
author | Nikias Bassen | 2010-07-29 23:25:36 +0200 |
---|---|---|
committer | Nikias Bassen | 2010-07-29 23:26:34 +0200 |
commit | b55329772d632f45bad7f84b4aec964c335e406d (patch) | |
tree | 6f245f0816d0686c30051ff1fb5f33b4fdb1505f | |
parent | 3785d9c6f22fb14ddb3d77678408cd1b478f3bda (diff) | |
download | libimobiledevice-b55329772d632f45bad7f84b4aec964c335e406d.tar.gz libimobiledevice-b55329772d632f45bad7f84b4aec964c335e406d.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); |