From 517f08e3b65d71a956912b8ee5a44aec12ac95de Mon Sep 17 00:00:00 2001 From: Maya Rashish Date: Sat, 2 Dec 2017 13:24:29 +0200 Subject: Fix inverted logic. Don't write more into a buffer than it can hold. https://bugzilla.gnome.org/show_bug.cgi?id=791124 --- bus/at-spi-bus-launcher.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bus/at-spi-bus-launcher.c b/bus/at-spi-bus-launcher.c index 93d8fada..4b2a440c 100644 --- a/bus/at-spi-bus-launcher.c +++ b/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; -- cgit v1.2.1