mirror of
https://github.com/Lekensteyn/ltunify.git
synced 2025-12-11 10:52:59 +00:00
read-dev-usbmon: fix crash on unplugging receiver
This commit is contained in:
@@ -118,6 +118,8 @@ int main(int argc, char ** argv) {
|
|||||||
printf("%02X%c", data[i],
|
printf("%02X%c", data[i],
|
||||||
i + 1 == hdr.len_cap ? '\n' : ' ');
|
i + 1 == hdr.len_cap ? '\n' : ' ');
|
||||||
}
|
}
|
||||||
|
} else if (hdr.len_cap > sizeof (struct report)) {
|
||||||
|
fprintf(stderr, "Discarding too large packet of length %u!\n", hdr.len_cap);
|
||||||
} else {
|
} else {
|
||||||
struct report *report = (struct report *)&data;
|
struct report *report = (struct report *)&data;
|
||||||
if (hdr.len_cap < 3) {
|
if (hdr.len_cap < 3) {
|
||||||
|
|||||||
Reference in New Issue
Block a user