diff options
author | William S Fulton <wsf@fultondesigns.co.uk> | 2012-11-18 00:43:31 +0000 |
---|---|---|
committer | William S Fulton <wsf@fultondesigns.co.uk> | 2012-11-18 00:43:31 +0000 |
commit | 111b517372e840979e78064b22888c1539bb5ec7 (patch) | |
tree | 998670601d86a753a28dae1b1ab94248443be317 /Source/Swig | |
parent | 69b32d921f9a2a257c5efb4a1694ff0e8526e0c5 (diff) | |
download | swig-111b517372e840979e78064b22888c1539bb5ec7.tar.gz |
Fix possible null dereferences
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@13900 626c5289-ae23-0410-ae9c-e8d60b6d4f22
Diffstat (limited to 'Source/Swig')
-rw-r--r-- | Source/Swig/typesys.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/Source/Swig/typesys.c b/Source/Swig/typesys.c index 73c2fbd50..76d84c960 100644 --- a/Source/Swig/typesys.c +++ b/Source/Swig/typesys.c @@ -668,7 +668,7 @@ SwigType *SwigType_typedef_resolve(const SwigType *t) { Printf(stdout, "namebase = '%s'\n", namebase); #endif type = typedef_resolve(s, namebase); - if (type) { + if (type && resolved_scope) { /* we need to look for the resolved type, this will also fix the resolved_scope if 'type' and 'namebase' are declared in different scopes */ @@ -680,7 +680,7 @@ SwigType *SwigType_typedef_resolve(const SwigType *t) { #ifdef SWIG_DEBUG Printf(stdout, "%s type = '%s'\n", Getattr(s, "name"), type); #endif - if ((type) && (!Swig_scopename_check(type)) && resolved_scope) { + if (type && (!Swig_scopename_check(type)) && resolved_scope) { Typetab *rtab = resolved_scope; String *qname = Getattr(resolved_scope, "qname"); /* If qualified *and* the typename is defined from the resolved scope, we qualify */ @@ -898,7 +898,7 @@ SwigType *SwigType_typedef_qualified(const SwigType *t) { e = ty; } resolved_scope = 0; - if (typedef_resolve(current_scope, e)) { + if (typedef_resolve(current_scope, e) && resolved_scope) { /* resolved_scope contains the scope that actually resolved the symbol */ String *qname = Getattr(resolved_scope, "qname"); if (qname) { |