]> granicus.if.org Git - libnl/commit
xfrm: fix potential NULL dereference
authorTobias Klauser <tklauser@distanz.ch>
Mon, 11 May 2015 12:49:01 +0000 (14:49 +0200)
committerThomas Haller <thaller@redhat.com>
Tue, 12 May 2015 11:14:26 +0000 (13:14 +0200)
commit4e115113c9e9fa391c177dfc113eceaf0a9cb8b4
tree2e190fefa6a3a08aac4100277f4f40442bfef82d
parenta214e75457e5ff049e04a4f7bac76d647e4fcb6d
xfrm: fix potential NULL dereference

If xfrmnl_sel_alloc() returns NULL, the daddr and saddr members are
still accessed, leading to a potential NULL dereference. The same is the
case for xfrmnl_user_tmpl_alloc(). Fix this by returning NULL right away
if allocation fails.

http://lists.infradead.org/pipermail/libnl/2015-May/001874.html

Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
Signed-off-by: Thomas Haller <thaller@redhat.com>
lib/xfrm/selector.c
lib/xfrm/template.c