summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohan Dahlin <jdahlin@async.com.br>2008-05-31 14:14:07 +0000
committerJohan Dahlin <johan@src.gnome.org>2008-05-31 14:14:07 +0000
commitc7bc4f4e6263db8a2914692dc75ff7b695a16dc3 (patch)
treedf28eeaf6307057a0a1a292baadcab62a8584180
parent7c74fa362e8750ed6acdb066a2d7d1dce44f6169 (diff)
downloadgobject-introspection-c7bc4f4e6263db8a2914692dc75ff7b695a16dc3.tar.gz
Prevent a crash when symbol->indent is NULL.
2008-05-31 Johan Dahlin <jdahlin@async.com.br> * giscanner/giscannermodule.c (symbol_get_ident): Prevent a crash when symbol->indent is NULL. svn path=/trunk/; revision=276
-rw-r--r--ChangeLog3
-rw-r--r--giscanner/giscannermodule.c7
2 files changed, 10 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index 17ee5afb..0935ab45 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
2008-05-31 Johan Dahlin <jdahlin@async.com.br>
+ * giscanner/giscannermodule.c (symbol_get_ident): Prevent
+ a crash when symbol->indent is NULL.
+
* giscanner/sourcescanner.py (ctype_name): Add ctype_name,
a function to convert a CTYPE symbol to a string
diff --git a/giscanner/giscannermodule.c b/giscanner/giscannermodule.c
index df258404..3d3e7d95 100644
--- a/giscanner/giscannermodule.c
+++ b/giscanner/giscannermodule.c
@@ -175,6 +175,13 @@ static PyObject *
symbol_get_ident (PyGISourceSymbol *self,
void *context)
{
+
+ if (!self->symbol->ident)
+ {
+ Py_INCREF(Py_None);
+ return Py_None;
+ }
+
return PyString_FromString (self->symbol->ident);
}