summaryrefslogtreecommitdiffstats
path: root/libusbmuxd/libusbmuxd.c
diff options
context:
space:
mode:
authorGravatar Nikias Bassen2010-04-03 02:44:48 +0200
committerGravatar Hector Martin2010-04-08 15:11:49 +0200
commitbcdac46984bea76ca5c47be55074d376a18b4a62 (patch)
tree8772e89175dd473b879f04cac63d914193e38738 /libusbmuxd/libusbmuxd.c
parentae85313617ef48b3b183b2077d4ffebde74ea101 (diff)
downloadusbmuxd-bcdac46984bea76ca5c47be55074d376a18b4a62.tar.gz
usbmuxd-bcdac46984bea76ca5c47be55074d376a18b4a62.tar.bz2
libusbmuxd: support shorter device info record messages
This adds support for older original usbmuxd implementations shipped with iTunes.
Diffstat (limited to 'libusbmuxd/libusbmuxd.c')
-rw-r--r--libusbmuxd/libusbmuxd.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libusbmuxd/libusbmuxd.c b/libusbmuxd/libusbmuxd.c
index 9084457..9349ef4 100644
--- a/libusbmuxd/libusbmuxd.c
+++ b/libusbmuxd/libusbmuxd.c
@@ -353,7 +353,7 @@ int usbmuxd_get_device_list(usbmuxd_device_info_t **device_list)
// receive device list
while (1) {
if (recv_buf_timeout(sfd, &hdr, sizeof(hdr), 0, 1000) == sizeof(hdr)) {
- if (hdr.length != sizeof(hdr)+sizeof(dev_info)) {
+ if ((hdr.length < 48) || (hdr.length > sizeof(hdr)+sizeof(dev_info))) {
// invalid packet size received!
fprintf(stderr,
"%s: Invalid packet size (%d) received when expecting a device info record.\n",