]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
WPS ER: Fix SSDP CACHE-CONTROL line parser
authorJouni Malinen <j@w1.fi>
Sat, 15 Aug 2015 19:24:15 +0000 (22:24 +0300)
committerJouni Malinen <j@w1.fi>
Sat, 15 Aug 2015 19:24:15 +0000 (22:24 +0300)
Incorrect number of bytes was skipped from the beginning of the line
which resulted in the loop skipping spaces doing nothing. However, the
following operation was simply looking for the max-age parameter with
os_strstr(), so this did not have any effect on functionality. Fix the
number of bytes to skip and remove the unneeded loop to skip spaces.

Signed-off-by: Jouni Malinen <j@w1.fi>
src/wps/wps_er_ssdp.c

index e381fecbdc86a51a4a4cacd46579340d20abefa5..280b2b3bde19518e590ca6b93334b3111d0cefa4 100644 (file)
@@ -78,9 +78,7 @@ static void wps_er_ssdp_rx(int sd, void *eloop_ctx, void *sock_ctx)
                        if (os_strstr(start, "ssdp:byebye"))
                                byebye = 1;
                } else if (os_strncasecmp(start, "CACHE-CONTROL:", 14) == 0) {
-                       start += 9;
-                       while (*start == ' ')
-                               start++;
+                       start += 14;
                        pos2 = os_strstr(start, "max-age=");
                        if (pos2 == NULL)
                                continue;