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