From 4c2b76eaa6d601c6e88213a3f426693a58ce61f3 Mon Sep 17 00:00:00 2001 From: phk Date: Tue, 25 Sep 2007 06:44:27 +0000 Subject: [PATCH] The first of a long sequence of committs, inspired by cranking up FlexeLints nitpicking to new heights: Make sure VRT_int_string() has enough room and assert that this was the case. git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@2014 d4fa192b-c00b-0410-8231-f00ffab90ce4 --- varnish-cache/bin/varnishd/cache_vrt.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/varnish-cache/bin/varnishd/cache_vrt.c b/varnish-cache/bin/varnishd/cache_vrt.c index 11f16269..28d190e2 100644 --- a/varnish-cache/bin/varnishd/cache_vrt.c +++ b/varnish-cache/bin/varnishd/cache_vrt.c @@ -484,11 +484,11 @@ char * VRT_int_string(struct sess *sp, int num) { char *p; - int size = 10; + int size = 12; p = WS_Alloc(sp->http->ws, size); AN(p); - snprintf(p, size, "%d", num); + assert(snprintf(p, size, "%d", num) < size); return (p); } -- 2.39.5