Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
emacs
emacs
Commits
f86852b4
Commit
f86852b4
authored
Jun 22, 2013
by
Paul Eggert
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
* process.c (wait_reading_process_output): Avoid int overflow
when reading more than 2 GiB total from a process.
parent
12adebe9
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
7 deletions
+9
-7
src/ChangeLog
src/ChangeLog
+5
-0
src/process.c
src/process.c
+4
-7
No files found.
src/ChangeLog
View file @
f86852b4
2013-06-22 Paul Eggert <eggert@cs.ucla.edu>
* process.c (wait_reading_process_output): Avoid int overflow
when reading more than 2 GiB total from a process.
2013-06-21 Paul Eggert <eggert@cs.ucla.edu>
* process.c (create_process): Handle a couple more cases,
...
...
src/process.c
View file @
f86852b4
...
...
@@ -4430,7 +4430,7 @@ wait_reading_process_output (intmax_t time_limit, int nsecs, int read_kbd,
&& ! EQ (wait_proc->status, Qrun)
&& ! EQ (wait_proc->status, Qconnect))
{
int nread, total_nread
= 0;
bool read_some_bytes
= 0;
clear_waiting_for_input ();
XSETPROCESS (proc, wait_proc);
...
...
@@ -4438,16 +4438,13 @@ wait_reading_process_output (intmax_t time_limit, int nsecs, int read_kbd,
/* Read data from the process, until we exhaust it. */
while (wait_proc->infd >= 0)
{
nread = read_process_output (proc, wait_proc->infd);
int
nread = read_process_output (proc, wait_proc->infd);
if (nread == 0)
break;
if (nread > 0)
{
total_nread += nread;
got_some_input = 1;
}
got_some_input = read_some_bytes = 1;
else if (nread == -1 && (errno == EIO || errno == EAGAIN))
break;
#ifdef EWOULDBLOCK
...
...
@@ -4455,7 +4452,7 @@ wait_reading_process_output (intmax_t time_limit, int nsecs, int read_kbd,
break;
#endif
}
if (
total_nread > 0
&& do_display)
if (
read_some_bytes
&& do_display)
redisplay_preserve_echo_area (10);
break;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment