mirror of
https://github.com/masscollaborationlabs/emacs.git
synced 2025-07-12 15:10:50 +00:00
Avoid undefined behavior in 'send-process-region' (Bug#52369).
* src/process.c (send_process): Signal an error if the file descriptor has already been closed.
This commit is contained in:
parent
30dd5c9acc
commit
8a0734329a
1 changed files with 3 additions and 0 deletions
|
@ -6520,6 +6520,9 @@ send_process (Lisp_Object proc, const char *buf, ptrdiff_t len,
|
||||||
/* Send this batch, using one or more write calls. */
|
/* Send this batch, using one or more write calls. */
|
||||||
ptrdiff_t written = 0;
|
ptrdiff_t written = 0;
|
||||||
int outfd = p->outfd;
|
int outfd = p->outfd;
|
||||||
|
if (outfd < 0)
|
||||||
|
error ("Output file descriptor of %s is closed",
|
||||||
|
SDATA (p->name));
|
||||||
eassert (0 <= outfd && outfd < FD_SETSIZE);
|
eassert (0 <= outfd && outfd < FD_SETSIZE);
|
||||||
#ifdef DATAGRAM_SOCKETS
|
#ifdef DATAGRAM_SOCKETS
|
||||||
if (DATAGRAM_CHAN_P (outfd))
|
if (DATAGRAM_CHAN_P (outfd))
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue