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