]> err.no Git - varnish/commitdiff
The first of a long sequence of committs, inspired by cranking up FlexeLints
authorphk <phk@d4fa192b-c00b-0410-8231-f00ffab90ce4>
Tue, 25 Sep 2007 06:44:27 +0000 (06:44 +0000)
committerphk <phk@d4fa192b-c00b-0410-8231-f00ffab90ce4>
Tue, 25 Sep 2007 06:44:27 +0000 (06:44 +0000)
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

index 11f162696240551f95dd7548e25cdd4d6c96a64c..28d190e2e4b5bbac279b860f8f116fa9afaaa401 100644 (file)
@@ -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);
 }