net: vmxnet: use g_new for pkt initialisation
commit47882fa4975bf0b58dd74474329fdd7154e8f04c
authorLi Qiang <liqiang6-s@360.cn>
Tue, 16 Aug 2016 11:28:01 +0000 (16 16:58 +0530)
committerJason Wang <jasowang@redhat.com>
Thu, 18 Aug 2016 04:05:18 +0000 (18 12:05 +0800)
tree72402d35a99e59a465b3a816eb5c10965bccd9fb
parent5f0e775348082c355769a3df612e055abea61c06
net: vmxnet: use g_new for pkt initialisation

When network transport abstraction layer initialises pkt, the maximum
fragmentation count is not checked. This could lead to an integer
overflow causing a NULL pointer dereference. Replace g_malloc() with
g_new() to catch the multiplication overflow.

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