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