]> git.ipfire.org Git - thirdparty/hostap.git/commit
WPS NFC: Fix potential NULL pointer dereference on an error path
authorYu Ouyang <yuo@codeaurora.org>
Mon, 3 Dec 2018 06:18:53 +0000 (14:18 +0800)
committerJouni Malinen <j@w1.fi>
Tue, 4 Dec 2018 18:52:34 +0000 (20:52 +0200)
commitf81e65510c8f74e2f22f37c66bd9f12d620ca13c
treef58eac3c5cbc91576c08931aa744e82d9368a1a8
parent0e1ab324cc8f07f4a132a8a2bae0da1b9aca19cd
WPS NFC: Fix potential NULL pointer dereference on an error path

The NFC connection handover specific case of WPS public key generation
did not verify whether the two wpabuf_dup() calls succeed. Those may
return NULL due to an allocation failure and that would result in a NULL
pointer dereference in dh5_init_fixed().

Fix this by checking memory allocation results explicitly. If either of
the allocations fail, do not try to initialize wps->dh_ctx and instead,
report the failure through the existing error case handler below.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org
src/wps/wps_attr_build.c