From patchwork Mon Oct 12 21:18:35 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Josh Lehan X-Patchwork-Id: 529472 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from maxx.maxx.shmoo.com (maxx.shmoo.com [205.134.188.171]) by ozlabs.org (Postfix) with ESMTP id 8085C1401DE for ; Tue, 13 Oct 2015 08:20:31 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=krellan.net header.i=@krellan.net header.b=I0RI3bRz; dkim-atps=neutral Received: from localhost (localhost [127.0.0.1]) by maxx.maxx.shmoo.com (Postfix) with ESMTP id 541A49D57D; Mon, 12 Oct 2015 17:20:29 -0400 (EDT) X-Virus-Scanned: amavisd-new at maxx.shmoo.com Received: from maxx.maxx.shmoo.com ([127.0.0.1]) by localhost (maxx.shmoo.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id GakEsFxsbGNS; Mon, 12 Oct 2015 17:20:29 -0400 (EDT) Received: from maxx.shmoo.com (localhost [127.0.0.1]) by maxx.maxx.shmoo.com (Postfix) with ESMTP id 9F3C89D58B; Mon, 12 Oct 2015 17:20:27 -0400 (EDT) X-Original-To: mailman-post+hostap@maxx.shmoo.com Delivered-To: mailman-post+hostap@maxx.shmoo.com Received: from localhost (localhost [127.0.0.1]) by maxx.maxx.shmoo.com (Postfix) with ESMTP id 52E5A9D58B for ; Mon, 12 Oct 2015 17:20:26 -0400 (EDT) X-Virus-Scanned: amavisd-new at maxx.shmoo.com Received: from maxx.maxx.shmoo.com ([127.0.0.1]) by localhost (maxx.shmoo.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 0ev8mL8U7nPJ for ; Mon, 12 Oct 2015 17:20:25 -0400 (EDT) Received: from tardis.krellan.net (tardis.krellan.net [70.36.220.57]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by maxx.maxx.shmoo.com (Postfix) with ESMTPS id DB25B9D57D for ; Mon, 12 Oct 2015 17:20:24 -0400 (EDT) Received: from tardis.krellan.net (treegold.krellan.net [10.6.9.251]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by tardis.krellan.net (Postfix) with ESMTPSA id E1A40400C9F; Mon, 12 Oct 2015 14:19:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=krellan.net; s=mydkim; t=1444684751; bh=7IxI4j+IGLRPmhEzIvwH/rXoByjwv1Gxrvd3jx+vSzY=; h=From:To:Cc:Subject:Date; b=I0RI3bRzyh454O5EndeR0STIaIAKJOaDaRQKvegAH1ZLLZWY+J2+tkRBdQczI4s8b dppen9BVZ7+QMWdWmJz59UKSabyhpVIHMak0IA0HfWBo1ledg+YSD92Q1p5KvGMQXc hCxqETsFUBrchBCIEZlFw/PmMhVdELtYRTVfywK8= From: Josh Lehan To: hostap@lists.shmoo.com Subject: [PATCH] DEL char (ASCII 127 decimal) now escaped Date: Mon, 12 Oct 2015 14:18:35 -0700 Message-Id: <1444684715-6418-1-git-send-email-krellan@krellan.net> X-Mailer: git-send-email 1.8.3.2 X-BeenThere: hostap@lists.shmoo.com X-Mailman-Version: 2.1.13 Precedence: list List-Id: HostAP Project List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: hostap-bounces@lists.shmoo.com Errors-To: hostap-bounces@lists.shmoo.com Hello! 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, here is a trivial patch to make it appear as an escaped \x7f instead of a literal DEL character in the output. I am trying to allow the choice of wireless network name and password to be as binary-clean as possible, and this will help. Thank you! Josh Lehan Signed-off-by: Josh Lehan --- src/utils/common.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/utils/common.c b/src/utils/common.c index 660e9fc..e74a2ae 100644 --- a/src/utils/common.c +++ b/src/utils/common.c @@ -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",