bugGnash - The GNU Flash player - Bugs: bug #46719, Gnash's `GetVariable()` returns...

 
 

bug #46719: Gnash's `GetVariable()` returns incorrect value of undefined variable under SWF5

Submitted by:  Nutchanon Wetchasit <nachanon>
Submitted on:  Sat 19 Dec 2015 04:33:41 PM UTC  
 
Category: coreSeverity: 3 - Normal
Release: masterStatus: None
Privacy: PublicAssigned to: None
Open/Closed: Open

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Mon 11 Jan 2016 03:04:23 PM UTC, comment #4:

Patch included, see patch #8851.

`getvariable-allver.html` output before applying the patch:

You'd see that under SWF5 and SWF6, `undefined` value of `unassigned_variable`
are translated to string "undefined", which is incorrect.

`getvariable-allver.html` output after applied the patch:

You'd see that output from patched Gnash is identical to output from Flash Player.

Gnash: 0.8.11dev (patched against git 15d61a8 26-Dec-2015)
Flash Player: 11.2 r202 (11.2.202.491) NPAPI binary
Browser: Iceweasel 10.0.12 (debian)
System: Debian GNU/Linux 7.0 Wheezy i386

Nutchanon Wetchasit <nachanon>
Mon 11 Jan 2016 02:20:17 PM UTC, comment #3:

I have also done some more test regarding behavior of `GetVariable()` when
fetching variable from sub-MovieClip loaded from a different SWF file
which uses a different SWF version (e.g. one loaded via `loadMovieNum()`).

Result is Flash Player acts on root movie's SWF version, not the version
of SWF that is loaded as the sub-MovieClip. That is when root movie is SWF7
and sub-movie is SWF5, `GetVariable()` will use SWF7 behavior. When root movie
is SWF5 and sub-movie is SWF7, `GetVariable()` will use SWF5 behavior.

Test file, text output, and screenshot from Flash Player are attached
as `getvariable-extmovie.zip` for reference.

Note: This test code does not work on current Gnash due to path notation
part of bug #42395, which caused `GetVariable()` to fail on sub-MovieClip.

Flash Player: 11.2 r202 (11.2.202.491) NPAPI binary
Browser: Iceweasel 10.0.12 (debian)
System: Debian GNU/Linux 7.0 Wheezy i386

(file #35990)

Nutchanon Wetchasit <nachanon>
Mon 11 Jan 2016 07:36:39 AM UTC, comment #2:

I have created a new test which checks `GetVariable()` on undefined
(unassigned) and nonexistent variable within SWF version 5-8 under Flash Player:

  • Under SWF 5-6, `undefined` value translates to an empty string.
  • Under SWF 7-8, `undefined` value translates to a string "undefined".

This is consistent to Adobe's documentation regarding `undefined` value
and Gnash's `as_value::to_string()` documentation, and also means that
current automated test must also be corrected so that expected value from
undefined/unassigned variable SWF6 is the same as SWF5.

Test SWF, source code, build script, HTML container, text output
and screenshot are attached as `getvariable-allver.zip` for reference.

Flash Player: 11.2 r202 (11.2.202.491) NPAPI binary
Browser: Iceweasel 10.0.12 (debian)
System: Debian GNU/Linux 7.0 Wheezy i386

(file #35985)

Nutchanon Wetchasit <nachanon>
Sat 26 Dec 2015 02:50:28 PM UTC, comment #1:

as_value::to_string(version) returns "undefined" for SWF6+ or "" for SWF5 and below. This might be the key to solve this bug (missing to pass the version parameter to to_string?)

Sandro Santilli <strk>
Project Member
Sat 19 Dec 2015 04:33:41 PM UTC, original submission:

This is a spin-off from bug #42395 (EFF panopticlick GetVariable issue).

As mentioned in bug #42395 comment 16, Flash Player return a value of
unassigned variable or variable with `undefined` value via `GetVariable()`
plugin call as an empty string if the running SWF was targeted to Flash 5.
Current Gnash returns a string "undefined", which is incorrect.

Two automated checks of this behavior on Gnash testsuite are provided in
`extgetvariable_testrunner`, currently giving XFAIL status.
One of them is also the same check used for verifying bug #45840
(timeline unassigned variable issue)'s behavior on SWF5.

Although Gnash's `GetVariable()` implementation could be rigged
to give an empty string under said condition as a stopgap measure,
it might need some testing to check if any specific nature of
`undefined` variable value under SWF5 (and below) caused this behavior,
so the underlying behavior difference (if any) could be fixed.

Note: If SWF version is higher than 5, Flash Player will return
a string "undefined" for such variable; current Gnash followed this correctly.

Gnash: 0.8.11dev (git 4c03566 19-Dec-2015) NPAPI
Adobe Flash Player: 11.2 r202 (11.2.202.491) NPAPI binary
Browser: Iceweasel 10.0.12 (debian)
System: Debian GNU/Linux 7.0 Wheezy i386

Nutchanon Wetchasit <nachanon>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach File(s):
   
   
Comment:
   

Attached Files
file #35990:  getvariable-extmovie.zip added by nachanon (9KiB - application/zip - Test SWF and code to test sub-MovieClip SWF version distinction)
file #35985:  getvariable-allver.zip added by nachanon (6KiB - application/zip - `undefined` GetVariable test Flash file, with source code and screenshots)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by strk (Posted a comment)
  • -unavailable- added by nachanon (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 2 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Mon 11 Jan 2016 02:20:17 PM UTCnachanonAttached File-=>Added getvariable-extmovie.zip, #35990
    Mon 11 Jan 2016 07:36:39 AM UTCnachanonAttached File-=>Added getvariable-allver.zip, #35985

    Back to the top


    Powered by Savane 3.1-cleanup1