[4.0] f7b3ef7 Report error in STV_FileSize on empty file and no size specified

Lasse Karstensen lkarsten at varnish-software.com
Thu Jan 15 16:35:40 CET 2015


commit f7b3ef748d670ec33fca9aaf264e13539c2ea1ff
Author: Martin Blix Grydeland <martin at varnish-software.com>
Date:   Tue Oct 7 12:44:37 2014 +0200

    Report error in STV_FileSize on empty file and no size specified

diff --git a/bin/varnishd/storage/stevedore_utils.c b/bin/varnishd/storage/stevedore_utils.c
index a86d57e..fe3514b 100644
--- a/bin/varnishd/storage/stevedore_utils.c
+++ b/bin/varnishd/storage/stevedore_utils.c
@@ -196,6 +196,9 @@ STV_FileSize(int fd, const char *size, unsigned *granularity, const char *ctx)
 		 * use its existing size.
 		 */
 		l = st.st_size;
+	} else if (size == NULL || *size == '\0') {
+		ARGV_ERR("(%s) no size specified\n",
+		    ctx);
 	} else {
 		AN(size);
 		q = VNUM_2bytes(size, &l, fssize);



More information about the varnish-commit mailing list