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