Keep track of the length of the string in ExpandVariables().
authorPascal Stumpf <Pascal.Stumpf@cubes.de>
Thu, 22 Nov 2012 13:27:26 +0000 (14:27 +0100)
committerJon Trulson <jon@radscan.com>
Sun, 25 Nov 2012 02:25:19 +0000 (19:25 -0700)
commitb49a4ffc9493a9819495c793cbdd18bab81f7bf3
treed3147c40126c5cb22c3475991e428d7216771c82
parentf84950100f49687d3023d8aa2630b153f0694dbb
Keep track of the length of the string in ExpandVariables().

On OpenBSD, the 'S' option to malloc(3) enables guard pages (among other
things).  This loop could have triggered this trap when reading beyond the
buffer.  Also, the whole "while(*ip)" construct was based on the assumption that
the memory after the string is always zero-filled.
cde/programs/dtdocbook/instant/translate.c