From c16be727a677b0393ea36c67c3c96b1e87c772fd Mon Sep 17 00:00:00 2001 From: Andrey Konovalov Date: Thu, 5 Sep 2019 19:01:29 +0200 Subject: executor: fix sigsegv for default USB string response --- executor/common_usb.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'executor/common_usb.h') 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); -- cgit mrf-deployment