[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Gnash-commit] /srv/bzr/gnash/avm2 r9685: Fix segfault caused by null ob
From: |
Tom Stellard |
Subject: |
[Gnash-commit] /srv/bzr/gnash/avm2 r9685: Fix segfault caused by null objects in the scope stack. |
Date: |
Sat, 15 Nov 2008 02:19:01 +0800 |
User-agent: |
Bazaar (1.5) |
------------------------------------------------------------
revno: 9685
committer: Tom Stellard <address@hidden>
branch nick: gnash_dev
timestamp: Sat 2008-11-15 02:19:01 +0800
message:
Fix segfault caused by null objects in the scope stack.
modified:
libcore/as_environment.cpp
libcore/vm/Machine.cpp
=== modified file 'libcore/as_environment.cpp'
--- a/libcore/as_environment.cpp 2008-11-06 19:04:35 +0000
+++ b/libcore/as_environment.cpp 2008-11-14 18:19:01 +0000
@@ -679,6 +679,7 @@
{
// const_cast needed due to non-const
as_object::get_member
as_object* obj =
const_cast<as_object*>((*scopeStack)[i-1].get());
+ if(!obj) continue;
element =
obj->get_path_element(subpartKey);
if ( element ) break;
}
=== modified file 'libcore/vm/Machine.cpp'
--- a/libcore/vm/Machine.cpp 2008-11-14 05:32:10 +0000
+++ b/libcore/vm/Machine.cpp 2008-11-14 18:19:01 +0000
@@ -2791,8 +2791,12 @@
mScopeStack.push(mGlobalObject);
for(size_t i=0;i<mScopeStack.size();i++)
{
-
- val =
mScopeStack.top(i).get()->getMember(multiname.getGlobalName(),multiname.getNamespace()->getURI());
+ as_object* scope_object = mScopeStack.top(i).get();
+ if(!scope_object){
+ LOG_DEBUG_AVM("Scope object is NULL.");
+ continue;
+ }
+ val =
scope_object->getMember(multiname.getGlobalName(),multiname.getNamespace()->getURI());
if(!val.is_undefined()){
push_stack(mScopeStack.top(i));
@@ -2808,7 +2812,6 @@
std::string ns =
mPoolObject->mStringPool[multiname.getNamespace()->getAbcURI()];
std::string path = ns.size() == 0 ? name : ns + "." + name;
val = env.get_variable(path,*getScopeStack(),&target);
- LOG_DEBUG_AVM("Got value.");
push_stack(as_value(target));
mScopeStack.pop();
return val;
- [Gnash-commit] /srv/bzr/gnash/avm2 r9685: Fix segfault caused by null objects in the scope stack.,
Tom Stellard <=
- Re: [Gnash-commit] /srv/bzr/gnash/avm2 r9685: Fix segfault caused by null objects in the scope stack., strk, 2008/11/14
- Re: [Gnash-commit] /srv/bzr/gnash/avm2 r9685: Fix segfault caused by null objects in the scope stack., Tom Stellard, 2008/11/14
- Re: [Gnash-commit] /srv/bzr/gnash/avm2 r9685: Fix segfault caused by null objects in the scope stack., strk, 2008/11/15
- Re: [Gnash-commit] /srv/bzr/gnash/avm2 r9685: Fix segfault caused by null objects in the scope stack., Tom Stellard, 2008/11/15
- Re: [Gnash-commit] /srv/bzr/gnash/avm2 r9685: Fix segfault caused by null objects in the scope stack., strk, 2008/11/16
- Re: [Gnash-commit] /srv/bzr/gnash/avm2 r9685: Fix segfault caused by null objects in the scope stack., Tom Stellard, 2008/11/17
- Re: [Gnash-commit] /srv/bzr/gnash/avm2 r9685: Fix segfault caused by null objects in the scope stack., strk, 2008/11/17