[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Gnash-commit] [bug #47004] Gnash didn't pass string return value "Error
From: |
Nutchanon Wetchasit |
Subject: |
[Gnash-commit] [bug #47004] Gnash didn't pass string return value "Error" and "SecurityError" from ExternalInterface callback |
Date: |
Sun, 31 Jan 2016 02:49:38 +0000 |
User-agent: |
Mozilla/5.0 (X11; Linux i686; rv:25.5) Gecko/20150606 Firefox/31.9 PaleMoon/25.5.0 |
Follow-up Comment #1, bug #47004 (project gnash):
This problem could be narrowed down to `plugin/npapi/callbacks.cpp`, inside
function `remoteCallback()` around line 707
<http://git.savannah.gnu.org/cgit/gnash.git/tree/plugin/npapi/callbacks.cpp?id=e705394a72888a8791497d94a7cf4c78b2e23f02#n702>:
std::string answer;
GnashNPVariant parsed = plugin::ExternalInterface::parseXML(data);
if (!NPVARIANT_IS_NULL(parsed.get())) {
answer = NPStringToString(NPVARIANT_TO_STRING(parsed.get()));
}
if (answer == "Error") {
NULL_TO_NPVARIANT(*result);
} else if (answer == "SecurityError") {
NULL_TO_NPVARIANT(*result);
} else {
parsed.copy(*result);
}
This check doesn't seem appropriate, as:
* It fails when ActionScript's callback legitimately returned a string "Error"
or "SecurityError"; demonstrated by test file.
* Bad things could happen if the return value is both not `null` and is not a
String. (e.g. `NPObject`)
Second one is actually the reason I found this issue in the first place;
this string conversion code crashes when I tried to make
`ExternalInterface::parseXML()` return a full-blown `NPObject` derived
from JavaScript `Object` (a part of bug #32411's fix).
Gnash: Gnash 0.8.11dev (git e705394 29-Jan-2016) NPAPI
Browser: Iceweasel 10.0.12
System: Debian GNU/Linux 7.0 Wheezy i386
_______________________________________________________
Reply to this item at:
<http://savannah.gnu.org/bugs/?47004>
_______________________________________________
Message sent via/by Savannah
http://savannah.gnu.org/