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