ping: prevent NULL pointer dereference on write to msg_name
authorHannes Frederic Sowa <hannes@stressinduktion.org>
Mon, 18 Nov 2013 06:07:45 +0000 (07:07 +0100)
committerLorenzo Colitti <lorenzo@google.com>
Thu, 30 Jan 2014 19:39:33 +0000 (11:39 -0800)
commit5a0312add72620b4bd67ccb7cde887ef2b95cd6d
treee4f18870436cfe464e0262b8ca3e4ac2d1b7a44b
parentb918c72ce27090051ac9681bfd162abcec0abceb
ping: prevent NULL pointer dereference on write to msg_name

A plain read() on a socket does set msg->msg_name to NULL. So check for
NULL pointer first.

[Backport of net-next cf970c002d270c36202bd5b9c2804d3097a52da0]

Bug: 12780426
Change-Id: I3df76aca2fa56478b9a33c404f7b1f0940475ef7
Signed-off-by: Hannes Frederic Sowa <hannes@stressinduktion.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Lorenzo Colitti <lorenzo@google.com>
net/ipv4/ping.c