summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorHarald Welte2011-07-16 17:48:20 +0200
committerHarald Welte2011-07-16 17:48:20 +0200
commitc9297d28e0484f58b4672e528610b7ba9e5aa073 (patch)
tree610ffaf161cfe2179c40a2172501950e70d1d041 /src
parentcalypso/irq: Fix array bounds checking (diff)
downloadosmocom-c9297d28e0484f58b4672e528610b7ba9e5aa073.tar.gz
osmocom-c9297d28e0484f58b4672e528610b7ba9e5aa073.tar.xz
osmocom-c9297d28e0484f58b4672e528610b7ba9e5aa073.zip
calypso/uart.c: Fix array bounds checking
Found by Smatch: calypso/uart.c +433 uart_baudrate(7) error: buffer overflow 'divider' 7 <= 7
Diffstat (limited to 'src')
-rw-r--r--src/target/firmware/calypso/uart.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/target/firmware/calypso/uart.c b/src/target/firmware/calypso/uart.c
index d3ede4d..bcb56bd 100644
--- a/src/target/firmware/calypso/uart.c
+++ b/src/target/firmware/calypso/uart.c
@@ -427,7 +427,7 @@ int uart_baudrate(uint8_t uart, enum uart_baudrate bdrt)
{
uint16_t div;
- if (bdrt > ARRAY_SIZE(divider))
+ if (bdrt >= ARRAY_SIZE(divider))
return -1;
div = divider[bdrt];