]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
WPS: Use 0xffff instead of -1 to set all u16 bits to 1
authorJouni Malinen <j@w1.fi>
Sun, 23 Feb 2025 14:34:53 +0000 (16:34 +0200)
committerJouni Malinen <j@w1.fi>
Sun, 23 Feb 2025 14:58:26 +0000 (16:58 +0200)
This avoids static analyzer warnings about overflowed constants.

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

index b6c9478ffe9bc6f36454772548ead0e8f12f944f..573eb592ff48f7ed61923657ae64e0baaf7bd971 100644 (file)
@@ -51,7 +51,7 @@ int upnp_er_set_selected_registrar(struct wps_registrar *reg,
                s->dev_password_id = attr.dev_password_id ?
                        WPA_GET_BE16(attr.dev_password_id) : DEV_PW_DEFAULT;
                s->config_methods = attr.sel_reg_config_methods ?
-                       WPA_GET_BE16(attr.sel_reg_config_methods) : -1;
+                       WPA_GET_BE16(attr.sel_reg_config_methods) : 0xffff;
                if (attr.authorized_macs) {
                        int count = attr.authorized_macs_len / ETH_ALEN;
                        if (count > WPS_MAX_AUTHORIZED_MACS)