Commit 3768a869 authored by Daniel Colascione's avatar Daniel Colascione

Don't underflow datagram_address array

parent 13539621
2014-03-23 Daniel Colascione <dancol@dancol.org>
* process.c (DATAGRAM_CONN_P): Don't underflow datagram_address
array. (ASAN caught.)
2014-03-22 Glenn Morris <rgm@gnu.org> 2014-03-22 Glenn Morris <rgm@gnu.org>
* callproc.c (init_callproc): In etc, look for NEWS rather than GNU. * callproc.c (init_callproc): In etc, look for NEWS rather than GNU.
......
...@@ -353,7 +353,10 @@ static struct sockaddr_and_len { ...@@ -353,7 +353,10 @@ static struct sockaddr_and_len {
int len; int len;
} datagram_address[FD_SETSIZE]; } datagram_address[FD_SETSIZE];
#define DATAGRAM_CHAN_P(chan) (datagram_address[chan].sa != 0) #define DATAGRAM_CHAN_P(chan) (datagram_address[chan].sa != 0)
#define DATAGRAM_CONN_P(proc) (PROCESSP (proc) && datagram_address[XPROCESS (proc)->infd].sa != 0) #define DATAGRAM_CONN_P(proc) \
(PROCESSP (proc) && \
XPROCESS (proc)->infd >= 0 && \
datagram_address[XPROCESS (proc)->infd].sa != 0)
#else #else
#define DATAGRAM_CHAN_P(chan) (0) #define DATAGRAM_CHAN_P(chan) (0)
#define DATAGRAM_CONN_P(proc) (0) #define DATAGRAM_CONN_P(proc) (0)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment