diff options
| author | Andrey Konovalov <andreyknvl@google.com> | 2019-09-05 19:01:29 +0200 |
|---|---|---|
| committer | Andrey Konovalov <andreyknvl@gmail.com> | 2019-09-05 19:03:35 +0200 |
| commit | c16be727a677b0393ea36c67c3c96b1e87c772fd (patch) | |
| tree | 523f40933808b28fb2ab8e86dab55c5cf32f4fe6 /executor/common_usb.h | |
| parent | bf6bcce4f2733d7869d2c73b437351a11d59c033 (diff) | |
executor: fix sigsegv for default USB string response
Diffstat (limited to 'executor/common_usb.h')
| -rw-r--r-- | executor/common_usb.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/executor/common_usb.h b/executor/common_usb.h index e342d8085..39c855331 100644 --- a/executor/common_usb.h +++ b/executor/common_usb.h @@ -199,7 +199,7 @@ static bool lookup_connect_response(struct vusb_connect_descriptors* descs, stru return true; case USB_DT_STRING: str_idx = (uint8)ctrl->wValue; - if (str_idx >= descs->strs_len) { + if (!descs || str_idx >= descs->strs_len) { // Use the default string if we ran out. *response_data = (char*)default_string; *response_length = strlen(default_string); |
