This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[PATCH 05/28] py-cmd.c error-checking bug fix
- From: Tom Tromey <tromey at redhat dot com>
- To: gdb-patches at sourceware dot org
- Date: Fri, 19 Apr 2013 08:29:19 -0600
- Subject: [PATCH 05/28] py-cmd.c error-checking bug fix
- References: <87ehe638ww dot fsf at fleche dot redhat dot com>
The checker found an error-checking bug in py-cmd.c.
This fixes it.
* py-cmd.c (gdbpy_string_to_argv): Check result of
PyList_New.
---
gdb/python/py-cmd.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/gdb/python/py-cmd.c b/gdb/python/py-cmd.c
index 3da9960..ca9e415 100644
--- a/gdb/python/py-cmd.c
+++ b/gdb/python/py-cmd.c
@@ -668,6 +668,8 @@ gdbpy_string_to_argv (PyObject *self, PyObject *args)
return NULL;
py_argv = PyList_New (0);
+ if (py_argv == NULL)
+ return NULL;
/* buildargv uses NULL to represent an empty argument list, but we can't use
that in Python. Instead, if ARGS is "" then return an empty list.
--
1.8.1.4