diff options
author | brueffer <brueffer@FreeBSD.org> | 2014-02-14 20:34:24 +0000 |
---|---|---|
committer | brueffer <brueffer@FreeBSD.org> | 2014-02-14 20:34:24 +0000 |
commit | a860c39644b50288a54d12b8eefadc8cd7dfac73 (patch) | |
tree | 7007c76671b9e572fded2d4408931cfbc16aa871 /usr.sbin | |
parent | 1588d44e170ea27530f859b627e874d4d02c33a7 (diff) | |
download | FreeBSD-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')
-rw-r--r-- | usr.sbin/ppp/chat.c | 5 |
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; } |