From c6f89deac00347faa187f2f5296e32840c4f26b4 Mon Sep 17 00:00:00 2001 From: Семён Марьясин Date: Thu, 9 Dec 2021 19:21:52 +0300 Subject: idevice: Fix sign issue in idevice_get_device_list_extended In sync with idevice_from_mux_device, line 384. Without this fix, data size 128 (the common value) is treated as -128, resulting in incorrect allocation. Related to #1248 but doesn't fully fix it. --- src/idevice.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/idevice.c b/src/idevice.c index adf47f4..22d57e3 100644 --- a/src/idevice.c +++ b/src/idevice.c @@ -284,7 +284,7 @@ LIBIMOBILEDEVICE_API idevice_error_t idevice_get_device_list_extended(idevice_in newlist[newcount]->conn_data = NULL; } else if (dev_list[i].conn_type == CONNECTION_TYPE_NETWORK) { newlist[newcount]->conn_type = CONNECTION_NETWORK; - size_t addrlen = dev_list[i].conn_data[0]; + size_t addrlen = ((uint8_t*)dev_list[i].conn_data)[0]; newlist[newcount]->conn_data = malloc(addrlen); memcpy(newlist[newcount]->conn_data, dev_list[i].conn_data, addrlen); } -- cgit v1.1-32-gdbae