projects
/
emacs.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
30dd5c9
)
Avoid undefined behavior in 'send-process-region' (Bug#52369).
author
Philipp Stephani
<phst@google.com>
Sat, 11 Dec 2021 12:51:34 +0000
(13:51 +0100)
committer
Philipp Stephani
<phst@google.com>
Sat, 11 Dec 2021 18:03:00 +0000
(19:03 +0100)
* src/process.c (send_process): Signal an error if the file descriptor
has already been closed.
src/process.c
patch
|
blob
|
history
diff --git
a/src/process.c
b/src/process.c
index 75ba191fa10157a9cae9d80520e59122d67f5c02..1d307d5242c7ad88b80473cfcae029adfe5da66b 100644
(file)
--- a/
src/process.c
+++ b/
src/process.c
@@
-6520,6
+6520,9
@@
send_process (Lisp_Object proc, const char *buf, ptrdiff_t len,
/* Send this batch, using one or more write calls. */
ptrdiff_t written = 0;
int outfd = p->outfd;
+ if (outfd < 0)
+ error ("Output file descriptor of %s is closed",
+ SDATA (p->name));
eassert (0 <= outfd && outfd < FD_SETSIZE);
#ifdef DATAGRAM_SOCKETS
if (DATAGRAM_CHAN_P (outfd))