prevent a heap overflow, see http://www.nabble.com/Bug-445889:-CVE-2007-4974-heap...