]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
Fix language string length validation in parse_lang_string()
authorJouni Malinen <jouni@qca.qualcomm.com>
Wed, 25 Sep 2013 09:53:00 +0000 (12:53 +0300)
committerJouni Malinen <j@w1.fi>
Wed, 25 Sep 2013 11:42:39 +0000 (14:42 +0300)
The language string length needs to be validated to hit into the
three-octet lang field in struct hostapd_lang_string before copying
this. Invalid configuration entries in hostapd.conf could have resulted
in buffer overflow.

Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>

hostapd/config_file.c

index 0b4fd772bbfdc7b7a6b4bcb47797f2331c8d1f30..49b6a413b1d79dc0756a4ef29decb36351a5e479 100644 (file)
@@ -1299,7 +1299,7 @@ static int parse_lang_string(struct hostapd_lang_string **array,
        *sep++ = '\0';
 
        clen = os_strlen(pos);
-       if (clen < 2)
+       if (clen < 2 || clen > sizeof(ls->lang))
                return -1;
        nlen = os_strlen(sep);
        if (nlen > 252)