Skip to content

Commit

Permalink
Update idevice.c
Browse files Browse the repository at this point in the history
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 libimobiledevice#1248 but doesn't fully fix it.
  • Loading branch information
MarSoft committed Dec 9, 2021
1 parent 2c6121d commit 8fdc769
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/idevice.c
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,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);
}
Expand Down

0 comments on commit 8fdc769

Please sign in to comment.