]> err.no Git - varnish/commit
The argv length calculation was not only off by one, but failed to take
authordes <des@d4fa192b-c00b-0410-8231-f00ffab90ce4>
Thu, 29 Mar 2007 10:49:58 +0000 (10:49 +0000)
committerdes <des@d4fa192b-c00b-0410-8231-f00ffab90ce4>
Thu, 29 Mar 2007 10:49:58 +0000 (10:49 +0000)
commit358d2d6534e6179eb24d2c73ba2c46e2f27ef486
tree10b30a0ab96b0c65bd98811097e0691a8f3bc9e5
parent1cb8456d4797d3787f1f9949ba1d0d161dc49ba1
The argv length calculation was not only off by one, but failed to take
into account the extra space required by expanded quotes, backslashes and
newlines.  Instead of pre-allocating a (possibly too short) buffer, start
with a 64-byte buffer and double it every time we come close to filling
it up.  Also, avoid appending a trailing space before the final newline.

This issue was uncovered by Kristoffer Gleditsch <kristoffer@linpro.no>,
who also helped test this patch.

git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@1287 d4fa192b-c00b-0410-8231-f00ffab90ce4
varnish-cache/bin/varnishd/mgt_cli.c