eiwd

no dbus iwd with iwctl functionality
git clone https://git.daat.foo/repos/eiwd.git
Log | Files | Refs | Submodules | README | LICENSE

commit 89309a862108c4caac41995b5fc76ade859d87a8
parent 5e0ff318e757d6dc36aa3b435d6d23e3d9e51072
Author: Jiajie Chen <c@jia.je>
Date:   Sun, 26 Feb 2023 14:25:25 +0800

knownnetworks: fix potential out of bounds write

If a very long ssid was used (e.g. CJK characters in SSID), it might do
out of bounds write to static variable for lack of checking the position
before the last snprintf() call.

Diffstat:
Msrc/knownnetworks.c | 3++-
1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/knownnetworks.c b/src/knownnetworks.c @@ -176,7 +176,8 @@ static const char *known_network_get_path(const struct network_info *network) pos += snprintf(path + pos, sizeof(path) - pos, "%02x", network->ssid[i]); - snprintf(path + pos, sizeof(path) - pos, "_%s", + if (pos < sizeof(path)) + snprintf(path + pos, sizeof(path) - pos, "_%s", security_to_str(network->type)); path[sizeof(path) - 1] = '\0';