зеркало из https://github.com/mozilla/pjs.git
Bug 522931 - textToSubURI.UnEscapeAndConvert(UTF-8, null) causes crash in NS_strdup [@strlen | NS_strdup(char const*) ]. r=smontagu
This commit is contained in:
Родитель
240e4b9ebb
Коммит
cb57ea40a6
|
@ -119,6 +119,11 @@ NS_IMETHODIMP nsTextToSubURI::UnEscapeAndConvert(
|
|||
{
|
||||
if(nsnull == _retval)
|
||||
return NS_ERROR_NULL_POINTER;
|
||||
if(nsnull == text) {
|
||||
// set empty string instead of returning error
|
||||
// due to compatibility for old version
|
||||
text = "";
|
||||
}
|
||||
*_retval = nsnull;
|
||||
nsresult rv = NS_OK;
|
||||
|
||||
|
|
|
@ -0,0 +1,6 @@
|
|||
// crash test with invaild parameter (bug 522931)
|
||||
function run_test()
|
||||
{
|
||||
var textToSubURI = Components.classes["@mozilla.org/intl/texttosuburi;1"].getService(Components.interfaces.nsITextToSubURI);
|
||||
do_check_eq(textToSubURI.UnEscapeAndConvert("UTF-8", null), "");
|
||||
}
|
Загрузка…
Ссылка в новой задаче