Fix for memory allocation off by 1 error. No bug. r: rhp (submitted by Ben Bucksch <mozilla-news@bucksch.org>

This commit is contained in:
rhp%netscape.com 1999-11-18 02:46:52 +00:00
parent 28e7445770
commit a554253a94

View File

@ -174,7 +174,7 @@ NS_COM PRInt32 nsUnescapeCount(char * str)
NS_COM char *
nsEscapeHTML(const char * string)
{
char *rv = (char *) nsAllocator::Alloc(nsCRT::strlen(string)*4 + 1); /* The +1 is for the trailing null! */
char *rv = (char *) nsAllocator::Alloc(nsCRT::strlen(string)*5 + 1); /* The +1 is for the trailing null! */
char *ptr = rv;
if(rv)