]> xenbits.xensource.com Git - qemu-upstream-4.3-testing.git/commit
pcnet: fix Negative array index read
authorGonglei <arei.gonglei@huawei.com>
Wed, 10 Jun 2015 11:49:18 +0000 (11:49 +0000)
committerStefano Stabellini <stefano.stabellini@eu.citrix.com>
Wed, 10 Jun 2015 11:49:18 +0000 (11:49 +0000)
commitf18719374c4242823ef0bc04fbd94840d62466e9
tree3f9f463868fb1867ae9d2ddb61fcfd09cde5fa59
parent447b1c5f24bb942f1b821e6a0e56e743dcffae84
pcnet: fix Negative array index read

s->xmit_pos maybe assigned to a negative value (-1),
but in this branch variable s->xmit_pos as an index to
array s->buffer. Let's add a check for s->xmit_pos.

upstream-commit-id: 7b50d00911ddd6d56a766ac5671e47304c20a21b

Signed-off-by: Gonglei <arei.gonglei@huawei.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Jason Wang <jasowang@redhat.com>
Reviewed-by: Jason Wang <jasowang@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
hw/pcnet.c