From: Tim Kourt <tim.a.kourt@linux.intel.com>
To: iwd@lists.01.org
Subject: [PATCH 1/2] client: Increase passphrase buffer to accommodate for nil byte
Date: Tue, 29 Oct 2019 15:33:08 -0700 [thread overview]
Message-ID: <20191029223309.25581-1-tim.a.kourt@linux.intel.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 995 bytes --]
---
client/display.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/client/display.c b/client/display.c
index cd17ad84..74b50e2e 100644
--- a/client/display.c
+++ b/client/display.c
@@ -397,7 +397,7 @@ static void display_completion_matches(char **matches, int num_matches,
static struct masked_input {
bool use_mask;
- char passphrase[MAX_PASSPHRASE_LEN];
+ char passphrase[MAX_PASSPHRASE_LEN + 1];
uint8_t point;
uint8_t end;
} masked_input;
@@ -436,6 +436,7 @@ static void mask_input(void)
masked_input.passphrase + masked_input.point
+ 1,
rl_end - rl_point);
+
memset(masked_input.passphrase + rl_end, 0,
masked_input.end - rl_end);
}
@@ -453,7 +454,7 @@ done:
static void reset_masked_input(void)
{
- memset(masked_input.passphrase, 0, MAX_PASSPHRASE_LEN);
+ memset(masked_input.passphrase, 0, MAX_PASSPHRASE_LEN + 1);
masked_input.point = 0;
masked_input.end = 0;
}
--
2.13.6
next reply other threads:[~2019-10-29 22:33 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-10-29 22:33 Tim Kourt [this message]
2019-10-29 22:33 ` [PATCH 2/2] client: Update rl_point to last known position Tim Kourt
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20191029223309.25581-1-tim.a.kourt@linux.intel.com \
--to=tim.a.kourt@linux.intel.com \
--cc=iwd@lists.01.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.