WPS ER: Check uuid_str2bin() return value
authorJouni Malinen <j@w1.fi>
Sun, 10 Jan 2010 20:12:55 +0000 (22:12 +0200)
committerJouni Malinen <j@w1.fi>
Sun, 10 Jan 2010 20:12:55 +0000 (22:12 +0200)
src/wps/wps_er.c
src/wps/wps_er_ssdp.c

index 8950ab4..f29eb9c 100644 (file)
@@ -479,7 +479,8 @@ static void wps_er_parse_device_description(struct wps_er_ap *ap,
        pos = os_strstr(ap->udn, "uuid:");
        if (pos) {
                pos += 5;
-               uuid_str2bin(pos, ap->uuid);
+               if (uuid_str2bin(pos, ap->uuid) < 0)
+                       wpa_printf(MSG_DEBUG, "WPS ER: Invalid UUID in UDN");
        }
 
        ap->upc = xml_get_first_item(data, "UPC");
index 83879db..f108435 100644 (file)
@@ -96,7 +96,12 @@ static void wps_er_ssdp_rx(int sd, void *eloop_ctx, void *sock_ctx)
                                pos2 += 5;
                                while (*pos2 == ' ')
                                        pos2++;
-                               uuid_str2bin(pos2, uuid);
+                               if (uuid_str2bin(pos2, uuid) < 0) {
+                                       wpa_printf(MSG_DEBUG, "WPS ER: "
+                                                  "Invalid UUID in USN: %s",
+                                                  pos2);
+                                       return;
+                               }
                        }
                }
        }