rsync: fix of-by-one in check of snprintf() result.

Fixes bug 11229.
This commit is contained in:
Stefan Behrens
2015-04-21 13:50:38 +02:00
committed by Wayne Davison
parent 962f8b9004
commit 3ea74eb388

2
io.c
View File

@@ -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);
}