diff options
| author | Daniel Colascione | 2014-03-22 22:15:48 -0700 |
|---|---|---|
| committer | Daniel Colascione | 2014-03-22 22:15:48 -0700 |
| commit | 3768a86998e3da26c091b138e86a0e2c80e82644 (patch) | |
| tree | 668c754476dc392a4d65537960f50badf2121c07 /src/process.c | |
| parent | 13539621ff4240e6d808e2e69158faa594670212 (diff) | |
| download | emacs-3768a86998e3da26c091b138e86a0e2c80e82644.tar.gz emacs-3768a86998e3da26c091b138e86a0e2c80e82644.zip | |
Don't underflow datagram_address array
Diffstat (limited to 'src/process.c')
| -rw-r--r-- | src/process.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/process.c b/src/process.c index 10a2984a053..fd34eb08d9d 100644 --- a/src/process.c +++ b/src/process.c | |||
| @@ -353,7 +353,10 @@ static struct sockaddr_and_len { | |||
| 353 | int len; | 353 | int len; |
| 354 | } datagram_address[FD_SETSIZE]; | 354 | } datagram_address[FD_SETSIZE]; |
| 355 | #define DATAGRAM_CHAN_P(chan) (datagram_address[chan].sa != 0) | 355 | #define DATAGRAM_CHAN_P(chan) (datagram_address[chan].sa != 0) |
| 356 | #define DATAGRAM_CONN_P(proc) (PROCESSP (proc) && datagram_address[XPROCESS (proc)->infd].sa != 0) | 356 | #define DATAGRAM_CONN_P(proc) \ |
| 357 | (PROCESSP (proc) && \ | ||
| 358 | XPROCESS (proc)->infd >= 0 && \ | ||
| 359 | datagram_address[XPROCESS (proc)->infd].sa != 0) | ||
| 357 | #else | 360 | #else |
| 358 | #define DATAGRAM_CHAN_P(chan) (0) | 361 | #define DATAGRAM_CHAN_P(chan) (0) |
| 359 | #define DATAGRAM_CONN_P(proc) (0) | 362 | #define DATAGRAM_CONN_P(proc) (0) |