]> git.ipfire.org Git - thirdparty/hostap.git/commit - src/ap/wpa_auth.c
Fix memcpy regression in PMK handling
authorJouni Malinen <j@w1.fi>
Sat, 23 Mar 2019 10:44:42 +0000 (12:44 +0200)
committerJouni Malinen <j@w1.fi>
Sat, 23 Mar 2019 10:44:42 +0000 (12:44 +0200)
commit08dc8efd29d2f94c65ba825e808d7284e84d1b2b
tree3de897391b6d1b6689e7e6146e3b2e66f49ca9af
parent130444738beab4ddfe9be2d3a232706eb91557c6
Fix memcpy regression in PMK handling

The memcpy calls added for exposing the PMK from wpa_auth module could
end up trying to copy the same memory buffer on top of itself.
Overlapping memory areas are not allowed with memcpy, so this could
result in undefined behavior. Fix this by making the copies conditional
on the updated value actually coming from somewhere else.

Fixes: b08c9ad0c78d ("AP: Expose PMK outside of wpa_auth module")
Signed-off-by: Jouni Malinen <j@w1.fi>
src/ap/wpa_auth.c