From 8edb889b753056a691a3e4b217a110a35f9fdedb Mon Sep 17 00:00:00 2001 From: Paul Mackerras Date: Sun, 3 Feb 2013 21:44:11 +1100 Subject: [PATCH 1/1] plugins/passprompt: Fix potential out-of-bounds array reference MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit From Debian BTS, fix suggested by Timo Weingärtner. Signed-off-by: Paul Mackerras --- pppd/plugins/passprompt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pppd/plugins/passprompt.c b/pppd/plugins/passprompt.c index 1d885fc..babb6dc 100644 --- a/pppd/plugins/passprompt.c +++ b/pppd/plugins/passprompt.c @@ -82,7 +82,6 @@ static int promptpass(char *user, char *passwd) } readgood += red; } while (readgood < MAXSECRETLEN - 1); - passwd[readgood] = 0; close(p[0]); /* now wait for child to exit */ @@ -95,6 +94,7 @@ static int promptpass(char *user, char *passwd) if (readgood < 0) return 0; + passwd[readgood] = 0; if (!WIFEXITED(wstat)) warn("%s terminated abnormally", promptprog); if (WEXITSTATUS(wstat)) -- 2.39.2