[master] ef8f969 Harmless off by one

Poul-Henning Kamp phk at FreeBSD.org
Thu Apr 16 09:07:39 CEST 2015


commit ef8f969ee32bc1bdbb7c4931b8cd714ac3832143
Author: Poul-Henning Kamp <phk at FreeBSD.org>
Date:   Thu Apr 16 07:07:25 2015 +0000

    Harmless off by one
    
    Spotted by: Coverity

diff --git a/bin/varnishd/mgt/mgt_main.c b/bin/varnishd/mgt/mgt_main.c
index 65395cb..25906f5 100644
--- a/bin/varnishd/mgt/mgt_main.c
+++ b/bin/varnishd/mgt/mgt_main.c
@@ -401,7 +401,7 @@ identify(const char *i_arg)
 	strcpy(id, "varnishd");
 
 	if (i_arg != NULL) {
-		if (strlen(i_arg) + 1 > sizeof heritage.identity)
+		if (strlen(i_arg) + 1 >= sizeof heritage.identity)
 			ARGV_ERR("Identity (-i) name too long.\n");
 		strncpy(heritage.identity, i_arg, sizeof heritage.identity);
 		i = strlen(id);



More information about the varnish-commit mailing list