]> xenbits.xensource.com Git - qemu-upstream-4.4-testing.git/commit
pcnet: fix Negative array index read
authorGonglei <arei.gonglei@huawei.com>
Wed, 10 Jun 2015 11:45:19 +0000 (11:45 +0000)
committerStefano Stabellini <stefano.stabellini@eu.citrix.com>
Wed, 10 Jun 2015 11:45:19 +0000 (11:45 +0000)
commit2800559b13911c2c128021313f2e367e44112a17
tree46f4a5a0a132b4e4e5e6a28cefc625e47dc3c8d9
parent81b17f7da635f98eb70519c0daa195c4b5b1ee9b
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/net/pcnet.c