From a860c39644b50288a54d12b8eefadc8cd7dfac73 Mon Sep 17 00:00:00 2001 From: brueffer Date: Fri, 14 Feb 2014 20:34:24 +0000 Subject: In chat_UpdateSet(), initialize the input buffer to prevent stale data from previous timed out commands. PR: 186530 Submitted by: Alexander Zagrebin Reviewed by: brian MFC after: 1 week --- usr.sbin/ppp/chat.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'usr.sbin/ppp') diff --git a/usr.sbin/ppp/chat.c b/usr.sbin/ppp/chat.c index 04b2679..daa52cd 100644 --- a/usr.sbin/ppp/chat.c +++ b/usr.sbin/ppp/chat.c @@ -154,6 +154,11 @@ chat_UpdateSet(struct fdescriptor *d, fd_set *r, fd_set *w, fd_set *e, int *n) else { /* c->state = CHAT_EXPECT; */ c->argptr = &arg_term; + /* + We have to clear the input buffer, because it contains output + from the previous (timed out) command. + */ + c->bufstart = c->bufend; } c->TimedOut = 0; } -- cgit v1.1