]> xenbits.xensource.com Git - qemu-xen-4.2-testing.git/commit
pcnet: fix Negative array index read
authorGonglei <arei.gonglei@huawei.com>
Tue, 23 Jun 2015 10:43:58 +0000 (11:43 +0100)
committerIan Jackson <Ian.Jackson@eu.citrix.com>
Tue, 23 Jun 2015 10:43:58 +0000 (11:43 +0100)
commit1ba285a22e34a1beb2f922d6e862e0575e8d020c
tree80d7e015ef79ebdf09d249cdf504bf9502d97952
parent1259e092ee27f444f683f0d76a13a8a72d3f26cb
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