summaryrefslogtreecommitdiffstats
path: root/usr.sbin/ppp
diff options
context:
space:
mode:
authorbrueffer <brueffer@FreeBSD.org>2014-02-14 20:34:24 +0000
committerbrueffer <brueffer@FreeBSD.org>2014-02-14 20:34:24 +0000
commita860c39644b50288a54d12b8eefadc8cd7dfac73 (patch)
tree7007c76671b9e572fded2d4408931cfbc16aa871 /usr.sbin/ppp
parent1588d44e170ea27530f859b627e874d4d02c33a7 (diff)
downloadFreeBSD-src-a860c39644b50288a54d12b8eefadc8cd7dfac73.zip
FreeBSD-src-a860c39644b50288a54d12b8eefadc8cd7dfac73.tar.gz
In chat_UpdateSet(), initialize the input buffer to prevent stale data
from previous timed out commands. PR: 186530 Submitted by: Alexander Zagrebin <alexz at visp.ru> Reviewed by: brian MFC after: 1 week
Diffstat (limited to 'usr.sbin/ppp')
-rw-r--r--usr.sbin/ppp/chat.c5
1 files changed, 5 insertions, 0 deletions
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;
}
OpenPOWER on IntegriCloud