[xchat-gnome/xchat-0-26-3] Bug 652866 - don't dereference a NULL	plugin
- From: Ritesh Khadgaray <rkhadgaray src gnome org>
- To: commits-list gnome org
- Cc: 
- Subject: [xchat-gnome/xchat-0-26-3] Bug 652866 - don't dereference a NULL	plugin
- Date: Mon, 20 Jun 2011 12:27:15 +0000 (UTC)
commit 8e1c0b0a49e797615c732fdfcb74225a6c6f6617
Author: Bill Nottingham <notting redhat com>
Date:   Mon Jun 20 17:55:09 2011 +0530
    Bug 652866 - don't dereference a NULL plugin
 plugins/python/python.c |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)
---
diff --git a/plugins/python/python.c b/plugins/python/python.c
index 53267a3..bcceed1 100644
--- a/plugins/python/python.c
+++ b/plugins/python/python.c
@@ -791,6 +791,8 @@ static PyObject *
 Context_set(ContextObject *self, PyObject *args)
 {
 	PyObject *plugin = Plugin_GetCurrent();
+	if (plugin == NULL)
+		return NULL;
 	Plugin_SetContext(plugin, self->context);
 	Py_INCREF(Py_None);
 	return Py_None;
@@ -867,8 +869,11 @@ static PyObject *
 Context_get_list(ContextObject *self, PyObject *args)
 {
 	PyObject *plugin = Plugin_GetCurrent();
-	xchat_context *saved_context = Plugin_GetContext(plugin);
+	xchat_context *saved_context;
 	PyObject *ret;
+	if (plugin == NULL)
+		return NULL;
+	saved_context = Plugin_GetContext(plugin);
 	Plugin_SetContext(plugin, self->context);
 	ret = Module_xchat_get_list((PyObject*)self, args);
 	Plugin_SetContext(plugin, saved_context);
[
Date Prev][
Date Next]   [
Thread Prev][
Thread Next]   
[
Thread Index]
[
Date Index]
[
Author Index]