[pygobject] Fix crash in error handling when creating struct with mismatched info type
- From: Simon Feltman <sfeltman src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [pygobject] Fix crash in error handling when creating struct with mismatched info type
- Date: Sun, 5 Jan 2014 01:14:24 +0000 (UTC)
commit 64f15961b637a7e1388bd8d2cd08f04fa20e4de4
Author: Simon Feltman <sfeltman src gnome org>
Date: Sat Jan 4 16:07:44 2014 -0800
Fix crash in error handling when creating struct with mismatched info type
Error handling code was attempting to get the PyType of a pointer to a
pointer. Use the correct amount of indirection so an exception is raised as
intended rather than a segfault.
gi/pygi-info.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/gi/pygi-info.c b/gi/pygi-info.c
index 5ef3145..af893ec 100644
--- a/gi/pygi-info.c
+++ b/gi/pygi-info.c
@@ -509,7 +509,7 @@ _pygi_object_get_gi_info (PyObject *object,
}
if (!PyObject_TypeCheck (py_info, type)) {
PyErr_Format (PyExc_TypeError, "attribute '__info__' must be %s, not %s",
- type->tp_name, Py_TYPE(&py_info)->tp_name);
+ type->tp_name, Py_TYPE(py_info)->tp_name);
goto out;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]