diff options
author | Pali Rohár <pali.rohar@gmail.com> | 2013-04-07 14:23:26 +0200 |
---|---|---|
committer | Pali Rohár <pali.rohar@gmail.com> | 2013-04-07 14:23:26 +0200 |
commit | 032538ec5acd9f648b237bd04aa9ae0b16868ee7 (patch) | |
tree | fa01df28d828c1d90f1058b4a1d7985c58436bf6 | |
parent | 2c34ec70d295f930326c65074883c0d52ccf6794 (diff) | |
download | 0xFFFF-032538ec5acd9f648b237bd04aa9ae0b16868ee7.tar.bz2 |
usb-device: Fix crashing when accessing out of global array usb_flash_protocols in function usb_flash_protocol_to_string
-rw-r--r-- | src/usb-device.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/usb-device.c b/src/usb-device.c index c36921a..00f83f5 100644 --- a/src/usb-device.c +++ b/src/usb-device.c @@ -52,7 +52,7 @@ static const char * usb_flash_protocols[] = { const char * usb_flash_protocol_to_string(enum usb_flash_protocol protocol) { - if ( protocol > sizeof(usb_flash_protocols) ) + if ( protocol >= sizeof(usb_flash_protocols)/sizeof(usb_flash_protocols[0]) ) return NULL; return usb_flash_protocols[protocol]; |