]> git.ipfire.org Git - thirdparty/qemu.git/commit
net: vmxnet: use g_new for pkt initialisation
authorLi Qiang <liqiang6-s@360.cn>
Mon, 22 Aug 2016 07:41:57 +0000 (13:11 +0530)
committerMichael Roth <mdroth@linux.vnet.ibm.com>
Thu, 8 Sep 2016 20:29:37 +0000 (15:29 -0500)
commitcb3677cd50dcb07e74d0113337e40e9e3e14d728
tree4c25d8caf4cb98440ac551ca2d0a61ee208e9aa1
parent93060258ae748573ca7197204125a2670047896d
net: vmxnet: use g_new for pkt initialisation

When vmxnet 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: Michael Roth <mdroth@linux.vnet.ibm.com>
hw/net/vmxnet_tx_pkt.c