From: Jouni Malinen Date: Sun, 23 Feb 2025 14:34:53 +0000 (+0200) Subject: WPS: Use 0xffff instead of -1 to set all u16 bits to 1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=dc05cbc46eda46fbc72cfe50f97ef5d93e1e56de;p=thirdparty%2Fhostap.git WPS: Use 0xffff instead of -1 to set all u16 bits to 1 This avoids static analyzer warnings about overflowed constants. Signed-off-by: Jouni Malinen --- diff --git a/src/wps/wps_upnp_ap.c b/src/wps/wps_upnp_ap.c index b6c9478ff..573eb592f 100644 --- a/src/wps/wps_upnp_ap.c +++ b/src/wps/wps_upnp_ap.c @@ -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)