Skip to content
Permalink
Browse files

Fix inverted logic.

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

https://bugzilla.gnome.org/show_bug.cgi?id=791124
  • Loading branch information...
coypoop authored and mgorse committed Dec 2, 2017
1 parent 319c640 commit b12d17b1d8cf15ab2de4b34b1a7e5d90904f744c
Showing with 1 addition and 1 deletion.
  1. +1 −1 bus/at-spi-bus-launcher.c
@@ -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;

0 comments on commit b12d17b

Please sign in to comment.
You can’t perform that action at this time.