Skip to content

dhcpcd_selectprofile: No buffer space available #726

Description

@akiernan

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions