OSDN Git Service
(root)
/
qmiga
/
qemu.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
39b3845
)
cadence_uart: Fix buffer overflow
author
Stefan Weil
<sw@weilnetz.de>
Sat, 1 Sep 2012 09:12:23 +0000
(11:12 +0200)
committer
Stefan Hajnoczi
<stefanha@gmail.com>
Sun, 23 Sep 2012 06:11:28 +0000
(07:11 +0100)
Report from smatch:
hw/cadence_uart.c:413 uart_read(13) error: buffer overflow 's->r' 18 <= 18
This fixes read access to s->r[R_MAX] which is behind the limits of s->r.
Signed-off-by: Stefan Weil <sw@weilnetz.de>
Signed-off-by: Stefan Hajnoczi <stefanha@gmail.com>
hw/cadence_uart.c
patch
|
blob
|
history
diff --git
a/hw/cadence_uart.c
b/hw/cadence_uart.c
index
d98e531
..
f8afc4e
100644
(file)
--- a/
hw/cadence_uart.c
+++ b/
hw/cadence_uart.c
@@
-404,7
+404,7
@@
static uint64_t uart_read(void *opaque, target_phys_addr_t offset,
uint32_t c = 0;
offset >>= 2;
- if (offset > R_MAX) {
+ if (offset >
=
R_MAX) {
return 0;
} else if (offset == R_TX_RX) {
uart_read_rx_fifo(s, &c);