diff options
| author | 2021-12-09 19:21:52 +0300 | |
|---|---|---|
| committer | 2022-05-02 13:01:50 +0200 | |
| commit | c6f89deac00347faa187f2f5296e32840c4f26b4 (patch) | |
| tree | 985598fd559d4c7823703932351e43fa340439fd | |
| parent | ed57735c8aa9cb803553f41bfc1fb99c2f4f463f (diff) | |
| download | libimobiledevice-c6f89deac00347faa187f2f5296e32840c4f26b4.tar.gz libimobiledevice-c6f89deac00347faa187f2f5296e32840c4f26b4.tar.bz2 | |
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.
| -rw-r--r-- | src/idevice.c | 2 |
1 files changed, 1 insertions, 1 deletions
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 | |||
| 284 | newlist[newcount]->conn_data = NULL; | 284 | newlist[newcount]->conn_data = NULL; |
| 285 | } else if (dev_list[i].conn_type == CONNECTION_TYPE_NETWORK) { | 285 | } else if (dev_list[i].conn_type == CONNECTION_TYPE_NETWORK) { |
| 286 | newlist[newcount]->conn_type = CONNECTION_NETWORK; | 286 | newlist[newcount]->conn_type = CONNECTION_NETWORK; |
| 287 | size_t addrlen = dev_list[i].conn_data[0]; | 287 | size_t addrlen = ((uint8_t*)dev_list[i].conn_data)[0]; |
| 288 | newlist[newcount]->conn_data = malloc(addrlen); | 288 | newlist[newcount]->conn_data = malloc(addrlen); |
| 289 | memcpy(newlist[newcount]->conn_data, dev_list[i].conn_data, addrlen); | 289 | memcpy(newlist[newcount]->conn_data, dev_list[i].conn_data, addrlen); |
| 290 | } | 290 | } |
