[PATCH] EAP-MSCHAPv2: Fix NULL pointer arithmetic in failure message parsing
Jouni Malinen
j at w1.fi
Sat Oct 24 07:57:01 PDT 2026
On Thu, Oct 08, 2026 at 02:55:47PM +0300, Andrei Otcheretianski wrote:
> os_strchr() can return NULL when the C= challenge field is the last
> field in the MSCHAPv2 failure message (no trailing space). The result
> was used directly in pointer arithmetic without a NULL check, which is
> undefined behavior.
>
> Fix by storing the os_strchr() result and falling back to end-of-string
> when no space delimiter is found.
Thanks, applied.
--
Jouni Malinen PGP id EFC895FA
More information about the Hostap
mailing list