зеркало из https://github.com/mozilla/gecko-dev.git
Bug 169321 - Passing strings generated by .match or .substr into Components.lookupMethod() was throwing exceptions because those strings
are not atomized. Checking in for Johnny Stenback <jst@netscape.com> r=dbradley@netscape.com, jaggernaut@netscape.com sr=brendan@mozilla.org
This commit is contained in:
Родитель
6c61080e81
Коммит
1c6a6a549a
|
@ -1825,6 +1825,14 @@ NS_IMETHODIMP nsXPCComponents::LookupMethod()
|
|||
if(!JSVAL_IS_STRING(argv[1]))
|
||||
return NS_ERROR_XPC_BAD_CONVERT_JS;
|
||||
|
||||
// Make sure the name (argv[1]) that we use for looking up the
|
||||
// method/property is atomized.
|
||||
|
||||
jsid name_id;
|
||||
if(!JS_ValueToId(cx, argv[1], &name_id) ||
|
||||
!JS_IdToValue(cx, name_id, &argv[1]))
|
||||
return NS_ERROR_XPC_BAD_CONVERT_JS;
|
||||
|
||||
// this will do verification and the method lookup for us
|
||||
XPCCallContext inner_cc(JS_CALLER, cx, obj, nsnull, argv[1]);
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче