Re: [Qemu-devel] [PATCH v2 for-2.2 3/4] pcnet: fix Negative array index read

2014-11-20 Thread Jason Wang
On 11/20/2014 07:35 PM, arei.gong...@huawei.com wrote: > From: Gonglei > > 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. > > Signed-off-by: Gonglei > Signed-off-by: Paolo Bonzini

[Qemu-devel] [PATCH v2 for-2.2 3/4] pcnet: fix Negative array index read

2014-11-20 Thread arei.gonglei
From: Gonglei 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. Signed-off-by: Gonglei Signed-off-by: Paolo Bonzini Reviewed-by: Jason Wang --- hw/net/pcnet.c | 55 ++