summaryrefslogtreecommitdiffstats
path: root/hw/ioh3420.c
diff options
context:
space:
mode:
authorStefan Weil <sw@weilnetz.de>2012-09-01 12:43:41 +0200
committerStefan Hajnoczi <stefanha@gmail.com>2012-09-23 07:11:28 +0100
commit8139626643cbe8dc07bd9acc88057effeedf8064 (patch)
treee41840bd148a3203e508a470ec4273099acb8a3d /hw/ioh3420.c
parent5d40097fc09fe5d34cf316a411dc27d455ac2cd0 (diff)
downloadhqemu-8139626643cbe8dc07bd9acc88057effeedf8064.zip
hqemu-8139626643cbe8dc07bd9acc88057effeedf8064.tar.gz
lm4549: Fix buffer overflow
Report from smatch: lm4549.c:234 lm4549_write_samples(14) error: buffer overflow 's->buffer' 1024 <= 1024 There must be enough space to add two entries starting with index s->buffer_level, therefore the old check was wrong. [Peter Maydell <peter.maydell@linaro.org> clarifies the nature of the analyser warning: I don't object to making the change to placate the analyser, but I don't think this is actually a buffer overrun. We always add and remove samples from the buffer two at a time, so it's not possible to get here with s->buffer_level == BUFFER_SIZE-1 (which is the only case where the old and new conditions give different answers).] Signed-off-by: Stefan Weil <sw@weilnetz.de> Signed-off-by: Stefan Hajnoczi <stefanha@gmail.com>
Diffstat (limited to 'hw/ioh3420.c')
0 files changed, 0 insertions, 0 deletions
OpenPOWER on IntegriCloud