]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
Make test code easier for static analyzers
authorJouni Malinen <quic_jouni@quicinc.com>
Mon, 22 Jan 2024 20:02:39 +0000 (22:02 +0200)
committerJouni Malinen <j@w1.fi>
Mon, 22 Jan 2024 20:16:49 +0000 (22:16 +0200)
The previous os_strncmp() calls have already verified that there is a
space in the string, so this os_strchr() call cannot really return NULL.
Anyway, make this easier for static analyzers to understand.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
wpa_supplicant/ctrl_iface.c

index 92b46a89749aea1a233a41567aaa2f5eb3ebdcc5..f3a31160f8a49722700eb8597812415bf96544da 100644 (file)
@@ -11235,6 +11235,8 @@ static int wpas_ctrl_iface_pasn_driver(struct wpa_supplicant *wpa_s,
                return -1;
 
        pos = os_strchr(pos, ' ');
+       if (!pos)
+               return -1;
        pos++;
        while (hwaddr_aton(pos, addr) == 0) {
                struct pasn_peer *peer;