]> asedeno.scripts.mit.edu Git - PuTTY.git/commit
Fix buffer management in strbuf_catfv.
authorSimon Tatham <anakin@pobox.com>
Mon, 20 Feb 2017 20:30:14 +0000 (20:30 +0000)
committerSimon Tatham <anakin@pobox.com>
Mon, 20 Feb 2017 20:46:04 +0000 (20:46 +0000)
commit7705fc4470b76ec7979dc00e5c97efd720d5e335
treed2a5a5405bfac6e620c4227176eaeed40269ae3d
parentbd65d477920b8d53833f6161e261fc6139a873ee
Fix buffer management in strbuf_catfv.

Thanks to Tim Kosse for pointing out that I had _completely_ cocked up
all the code that was supposed to enlarge the buffer in the strbuf
structure, by failing to pass in 'oldsize' to the innermost
dupvprintf_inner function by reference, so that the size was never
updated.

Fortunately, this whole mechanism was something I dashed off for the
purposes of buildinfo(), which means it's only ever used to glue
together a fixed number of compile-time string constants, for which
there turns out to be plenty to spare in the standard 512 bytes
allocated to a new strbuf. So it's at least not dangerous, though it
clearly needs to be fixed before I make the mistake of using
strbuf_catf[v] for anything else!
misc.c