r5474 - trunk/varnish-cache/bin/varnishd

phk at varnish-cache.org phk at varnish-cache.org
Wed Oct 27 13:25:55 CEST 2010


Author: phk
Date: 2010-10-27 13:25:55 +0200 (Wed, 27 Oct 2010)
New Revision: 5474

Modified:
   trunk/varnish-cache/bin/varnishd/cache_backend_cfg.c
Log:
Allocate an entire sockaddr_storage for backend address
entries, in order to guarantee type safety.



Modified: trunk/varnish-cache/bin/varnishd/cache_backend_cfg.c
===================================================================
--- trunk/varnish-cache/bin/varnishd/cache_backend_cfg.c	2010-10-27 10:24:11 UTC (rev 5473)
+++ trunk/varnish-cache/bin/varnishd/cache_backend_cfg.c	2010-10-27 11:25:55 UTC (rev 5474)
@@ -156,7 +156,7 @@
 {
 
 	assert(*src > 0);
-	*sa = malloc(*src);
+	*sa = calloc(sizeof **sa, 1);
 	XXXAN(*sa);
 	memcpy(*sa, src + 1, *src);
 	*len = *src;




More information about the varnish-commit mailing list