]> xenbits.xensource.com Git - qemu-upstream-4.5-testing.git/commit
pcnet: fix Negative array index read
authorGonglei <arei.gonglei@huawei.com>
Wed, 10 Jun 2015 11:43:50 +0000 (11:43 +0000)
committerStefano Stabellini <stefano.stabellini@eu.citrix.com>
Wed, 10 Jun 2015 11:43:50 +0000 (11:43 +0000)
commit1e01612c9a6e6ca4a8c86f87bd6a36ef645f1340
tree76e813e3f716210d7f039aa76242a5422419db1b
parent4f7865d19f3db71ce23585eb6a01f8521361878d
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/net/pcnet.c