Pre-allocate buffer to avoid core dump in corner cases. PR:		2968 Submitted by:	Gareth McCaughan <gjm11@dpmms.cam.ac.uk>
Pre-allocate buffer to avoid core dump in corner cases.
PR:		2968
Submitted by:	Gareth McCaughan <gjm11@dpmms.cam.ac.uk>

jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase