Skip to content

Commit c05f127

Browse files
committed
also check for null string
1 parent 54c27b0 commit c05f127

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/arduino/Adafruit_USBD_Device.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ void Adafruit_USBD_Device::setSerialDescriptor(const char *s) {
127127
}
128128

129129
uint8_t Adafruit_USBD_Device::addStringDescriptor(const char *s) {
130-
if (_desc_str_count >= STRING_DESCRIPTOR_MAX) {
130+
if (_desc_str_count >= STRING_DESCRIPTOR_MAX || s == NULL) {
131131
return 0;
132132
}
133133

0 commit comments

Comments
 (0)