From 8edbe4daaa0948b3a718e376b9c4d2d847e4e2c1 Mon Sep 17 00:00:00 2001 From: Denys Vlasenko Date: Thu, 20 Jan 2011 15:12:42 +0100 Subject: python: fix SEGV on crash_data().get("nonexistent") Signed-off-by: Denys Vlasenko --- src/report-python/crash_data.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/report-python/crash_data.c') diff --git a/src/report-python/crash_data.c b/src/report-python/crash_data.c index 04a721cc..217560e5 100644 --- a/src/report-python/crash_data.c +++ b/src/report-python/crash_data.c @@ -82,6 +82,10 @@ static PyObject *p_get_crash_data_item(PyObject *pself, PyObject *args) return NULL; } struct crash_item *ci = get_crash_data_item_or_NULL(self->cd, key); + if (ci == NULL) + { + Py_RETURN_NONE; + } return Py_BuildValue("sI", ci->content, ci->flags); } -- cgit