Signedness security patch from Sebastian Krahmer <krahmer@suse.de> --
[rsync/rsync.git] / log.c
diff --git a/log.c b/log.c
index 3b53a9a..421829b 100644 (file)
--- a/log.c
+++ b/log.c
@@ -466,7 +466,7 @@ static void log_formatted(enum logcode code,
 
                l = strlen(n);
 
-               if ((l-1) + ((int)(s - &buf[0])) > sizeof(buf)) {
+               if (l + ((int)(s - &buf[0])) >= sizeof(buf)) {
                        rprintf(FERROR,"buffer overflow expanding %%%c - exiting\n",
                                p[0]);
                        exit_cleanup(RERR_MESSAGEIO);