From 827a3c3d8e53eabefcaf81b2944dad5e79e8031a Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Mon, 2 Jun 2014 17:44:30 -0700 Subject: [PATCH] * process.c (wait_reading_process_output): Omit incorrect test of p->infd against zero. Add easserts for infd having a plausible value. --- src/ChangeLog | 6 ++++++ src/process.c | 5 ++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/src/ChangeLog b/src/ChangeLog index f0c0c973be8..ded001073ae 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,9 @@ +2014-06-03 Paul Eggert + + * process.c (wait_reading_process_output): Omit incorrect test + of p->infd against zero. Add easserts for infd having a plausible + value. + 2014-06-02 Dmitry Antipov Adjust to match recent lwlib changes. diff --git a/src/process.c b/src/process.c index 561aefc6c9f..e77dcb2b41e 100644 --- a/src/process.c +++ b/src/process.c @@ -4630,12 +4630,13 @@ wait_reading_process_output (intmax_t time_limit, int nsecs, int read_kbd, { struct Lisp_Process *p = XPROCESS (chan_process[channel]); - if (p && p->gnutls_p && p->gnutls_state && p->infd + if (p && p->gnutls_p && p->gnutls_state && ((emacs_gnutls_record_check_pending (p->gnutls_state)) > 0)) { nfds++; + eassert (p->infd == channel); FD_SET (p->infd, &Available); } } @@ -4651,6 +4652,8 @@ wait_reading_process_output (intmax_t time_limit, int nsecs, int read_kbd, > 0)) { nfds = 1; + eassert (0 <= wait_proc->infd + && wait_proc->infd < FD_SETSIZE); /* Set to Available. */ FD_SET (wait_proc->infd, &Available); } -- 2.39.2