net: check fragment length during fragmentation
commitead315e43ea0c2ca3491209c6c8db8ce3f2bbe05
authorPrasad J Pandit <pjp@fedoraproject.org>
Thu, 4 Aug 2016 07:30:14 +0000 (4 13:00 +0530)
committerJason Wang <jasowang@redhat.com>
Tue, 9 Aug 2016 03:45:30 +0000 (9 11:45 +0800)
tree1b585f632f29d68416b3535f62f0699cfee0dec8
parent53279c76cf071fed07a336948d37c72e3613e0b7
net: check fragment length during fragmentation

Network transport abstraction layer supports packet fragmentation.
While fragmenting a packet, it checks for more fragments from
packet length and current fragment length. It is susceptible
to an infinite loop, if the current fragment length is zero.
Add check to avoid it.

Reported-by: Li Qiang <liqiang6-s@360.cn>
Signed-off-by: Prasad J Pandit <pjp@fedoraproject.org>
Reviewed-by: Dmitry Fleytman <dmitry@daynix.com>
CC: qemu-stable@nongnu.org
Signed-off-by: Jason Wang <jasowang@redhat.com>
hw/net/net_tx_pkt.c