]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
Escape DEL char (ASCII 127 decimal) in SSIDs
authorJosh Lehan <krellan@krellan.net>
Mon, 12 Oct 2015 21:18:35 +0000 (14:18 -0700)
committerJouni Malinen <j@w1.fi>
Wed, 14 Oct 2015 16:28:57 +0000 (19:28 +0300)
While testing, I noticed that printf_encode() makes control characters
human-readable, with one exemption, the DEL character (ASCII 127).
Assuming this exemption was unintentional, make it appear as an escaped
\x7f instead of a literal DEL character in the output.

Signed-off-by: Josh Lehan <krellan@krellan.net>
src/utils/common.c

index 660e9fc985d69ddebeb8764bd5a513c91ac3acba..e74a2ae75104ea01a36023157a73c3860515d0ec 100644 (file)
@@ -498,7 +498,7 @@ void printf_encode(char *txt, size_t maxlen, const u8 *data, size_t len)
                        *txt++ = 't';
                        break;
                default:
-                       if (data[i] >= 32 && data[i] <= 127) {
+                       if (data[i] >= 32 && data[i] <= 126) {
                                *txt++ = data[i];
                        } else {
                                txt += os_snprintf(txt, end - txt, "\\x%02x",