Associating with a network whose SSID contains non-ASCII characters:
wlan0: connected to Access Point: WPA3\354\231\200\354\235\264\355\214\214\354\235\264\347\204\241\347\267\232\344\270\212\347\266\262WiFi
dhcpcd_selectprofile: No buffer space available
The SSID is deliberately 32 bytes, with UTF-8 (a test from a different project, but useful here!).
Tracing through the code dhcpcd_selectprofile() escapes the SSID into char pssid[PROFILE_LEN], PROFILE_LEN is 64, print_string() renders each non-printable byte as \NNN (four characters), and an SSID may be IF_SSIDLEN (32 bytes). The worst case therefore needs 32 * 4 + 1 = 129 bytes.
This is not a security issue, nothing is written past the end of either buffer. pssid is NUL-terminated on every path.
dhcpcd_reportssid() escapes the same ssid into a buffer sized differently (and explains why the reported ssid is visible in the log line):
dhcpcd.c:720 dhcpcd_reportssid() char pssid[IF_SSIDLEN * 4]; 128 - OK
From the maths above, this allocation is one byte short for the trailing NUL; again not a security issue.
Associating with a network whose SSID contains non-ASCII characters:
The SSID is deliberately 32 bytes, with UTF-8 (a test from a different project, but useful here!).
Tracing through the code
dhcpcd_selectprofile()escapes the SSID intochar pssid[PROFILE_LEN],PROFILE_LENis 64,print_string()renders each non-printable byte as \NNN (four characters), and an SSID may beIF_SSIDLEN(32 bytes). The worst case therefore needs 32 * 4 + 1 = 129 bytes.This is not a security issue, nothing is written past the end of either buffer. pssid is NUL-terminated on every path.
dhcpcd_reportssid()escapes the same ssid into a buffer sized differently (and explains why the reported ssid is visible in the log line):From the maths above, this allocation is one byte short for the trailing NUL; again not a security issue.