projects
/
osmocom-bb.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
5339425
)
calypso/uart.c: Fix array bounds checking
author
Harald Welte
<laforge@gnumonks.org>
Sat, 16 Jul 2011 15:48:20 +0000
(17:48 +0200)
committer
Harald Welte
<laforge@gnumonks.org>
Sat, 16 Jul 2011 15:48:20 +0000
(17:48 +0200)
Found by Smatch:
calypso/uart.c +433 uart_baudrate(7) error: buffer overflow 'divider' 7 <= 7
src/target/firmware/calypso/uart.c
patch
|
blob
|
history
diff --git
a/src/target/firmware/calypso/uart.c
b/src/target/firmware/calypso/uart.c
index
d3ede4d
..
bcb56bd
100644
(file)
--- 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];