Bug 786687 - Add null check for passed parameter to NS_strlen r=dougt

This commit is contained in:
Andrew Quartey 2012-09-04 11:12:33 -04:00
parent e50615ae01
commit 1a6d9aa263

View File

@ -45,7 +45,7 @@ NS_IMETHODIMP nsTextToSubURI::ConvertAndEscape(
{
char buf[256];
char *pBuf = buf;
int32_t ulen = NS_strlen(text);
int32_t ulen = text ? NS_strlen(text) : 0;
int32_t outlen = 0;
if(NS_SUCCEEDED(rv = encoder->GetMaxLength(text, ulen, &outlen)))
{