mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-01-01 21:10:12 +01:00
wifi: reject WPS PSK secret with non-UTF-8 characters (part 2)
We must reject '\0' characters inside the PSK as well.
Fixes: ac436dc2c4
This commit is contained in:
parent
d5c857307e
commit
5b4cf8f762
1 changed files with 1 additions and 1 deletions
|
|
@ -1856,7 +1856,7 @@ supplicant_iface_wps_credentials_cb (NMSupplicantInterface *iface,
|
|||
if (psk_len >= 8 && psk_len <= 63) {
|
||||
memcpy (psk, array, psk_len);
|
||||
psk[psk_len] = '\0';
|
||||
if (g_utf8_validate (psk, -1, NULL)) {
|
||||
if (g_utf8_validate (psk, psk_len, NULL)) {
|
||||
secrets = g_variant_new_parsed ("[{%s, [{%s, <%s>}]}]",
|
||||
NM_SETTING_WIRELESS_SECURITY_SETTING_NAME,
|
||||
NM_SETTING_WIRELESS_SECURITY_PSK, psk);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue