Commit 517f08e3 authored by Maya Rashish's avatar Maya Rashish Committed by Mike Gorse

Fix inverted logic.

Don't write more into a buffer than it can hold.

https://bugzilla.gnome.org/show_bug.cgi?id=791124
parent f2932260
......@@ -244,7 +244,7 @@ unix_read_all_fd_to_string (int fd,
{
ssize_t bytes_read;
while (max_bytes > 1 && (bytes_read = read (fd, buf, MAX (4096, max_bytes - 1))))
while (max_bytes > 1 && (bytes_read = read (fd, buf, MIN (4096, max_bytes - 1))))
{
if (bytes_read < 0)
return FALSE;
......
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