summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMaya Rashish <maya@NetBSD.org>2017-12-02 13:24:29 +0200
committerMike Gorse <mgorse@alum.wpi.edu>2017-12-04 10:08:13 -0600
commitb12d17b1d8cf15ab2de4b34b1a7e5d90904f744c (patch)
tree51ed118e28ed318e9cdd8049a0e8027e6a4f414e
parent319c6405062d8fe2fa2d016462395b992d8fb764 (diff)
downloadat-spi2-core-b12d17b1d8cf15ab2de4b34b1a7e5d90904f744c.tar.gz
Fix inverted logic.
Don't write more into a buffer than it can hold. https://bugzilla.gnome.org/show_bug.cgi?id=791124
-rw-r--r--bus/at-spi-bus-launcher.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/bus/at-spi-bus-launcher.c b/bus/at-spi-bus-launcher.c
index 261353f9..eb2b8e33 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;