From: Jouni Malinen Date: Thu, 25 Aug 2022 21:25:17 +0000 (+0300) Subject: DPP: Fix DPP_RELAY_ADD_CONTROLLER command parsing X-Git-Tag: hostap_2_11~1765 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=54706957e3e417f1b3cd8fe4a7935c9c38973da4;p=thirdparty%2Fhostap.git DPP: Fix DPP_RELAY_ADD_CONTROLLER command parsing hostapd_dpp_add_controller() ended up trying to parse the IP address without nul terminating it. This might work with some C libraries, but not all. And anyway, this was already supposed to nul terminate the string since a temporary copy is created of the constant string. Fix this by adding the missed replacement of the space with nul. Fixes: bfe3cfc382d6 ("DPP: Allow Relay connections to Controllers to be added and removed") Signed-off-by: Jouni Malinen --- diff --git a/src/ap/dpp_hostapd.c b/src/ap/dpp_hostapd.c index 7055784c4..232b5fbbc 100644 --- a/src/ap/dpp_hostapd.c +++ b/src/ap/dpp_hostapd.c @@ -3427,7 +3427,7 @@ int hostapd_dpp_add_controller(struct hostapd_data *hapd, const char *cmd) pos = os_strchr(tmp, ' '); if (!pos) goto fail; - pos++; + *pos++ = '\0'; if (hostapd_parse_ip_addr(tmp, &addr) < 0 || hexstr2bin(pos, pkhash, SHA256_MAC_LEN) < 0) goto fail;