]> git.ipfire.org Git - thirdparty/rsync.git/commitdiff
rsync: fix of-by-one in check of snprintf() result.
authorStefan Behrens <sbehrens@giantdisaster.de>
Tue, 21 Apr 2015 11:50:38 +0000 (13:50 +0200)
committerWayne Davison <wayned@samba.org>
Wed, 22 Apr 2015 17:31:04 +0000 (10:31 -0700)
Fixes bug 11229.

io.c

diff --git a/io.c b/io.c
index a868fa9caa4307e839821f1e84de1bab2a3bdcd8..01c6db179e0d38784c2412da83ebb15b7f9af23b 100644 (file)
--- a/io.c
+++ b/io.c
@@ -2283,7 +2283,7 @@ void io_printf(int fd, const char *format, ...)
        if (len < 0)
                exit_cleanup(RERR_PROTOCOL);
 
-       if (len > (int)sizeof buf) {
+       if (len >= (int)sizeof buf) {
                rprintf(FERROR, "io_printf() was too long for the buffer.\n");
                exit_cleanup(RERR_PROTOCOL);
        }