Check input for the null pointer and empty string, bug 17287, r=ducarroz,jefft.

This commit is contained in:
nhotta%netscape.com 1999-10-28 20:41:45 +00:00
parent f93347967c
commit 042fc6540b

View File

@ -96,6 +96,10 @@ nsSaveAsCharset::Convert(const PRUnichar *inString, char **_retval)
{
if (nsnull == _retval)
return NS_ERROR_NULL_POINTER;
if (nsnull == inString)
return NS_ERROR_NULL_POINTER;
if (0 == *inString)
return NS_ERROR_ILLEGAL_VALUE;
nsresult rv;
if (NULL == mEncoder) return NS_ERROR_FAILURE; // need to call Init() before Convert()