This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
FYI: fix termination in py-value.c
- From: Tom Tromey <tromey at redhat dot com>
- To: gdb-patches at sourceware dot org
- Date: Tue, 29 Sep 2009 09:15:31 -0600
- Subject: FYI: fix termination in py-value.c
- Reply-to: tromey at redhat dot com
I'm checking this in on the trunk and the 7.0 branch.
This fixes an obvious bug in py-value.c -- the "keywords" array in
valpy_string was not NULL-terminated.
Ulrich reports that this fixes most of the Python failures he was
seeing.
Tom
ChangeLog:
2009-09-29 Tom Tromey <tromey@redhat.com>
* python/py-value.c (valpy_string): NULL-terminate 'keywords'.
cvs diff: Diffing .
Index: python/py-value.c
===================================================================
RCS file: /cvs/src/src/gdb/python/py-value.c,v
retrieving revision 1.4
diff -u -c -r1.4 py-value.c
cvs diff: conflicting specifications of output style
*** python/py-value.c 25 Sep 2009 21:39:53 -0000 1.4
--- python/py-value.c 29 Sep 2009 15:11:58 -0000
***************
*** 239,245 ****
const char *user_encoding = NULL;
const char *la_encoding = NULL;
struct type *char_type;
! static char *keywords[] = { "encoding", "errors", "length" };
if (!PyArg_ParseTupleAndKeywords (args, kw, "|ssi", keywords,
&user_encoding, &errors, &length))
--- 239,245 ----
const char *user_encoding = NULL;
const char *la_encoding = NULL;
struct type *char_type;
! static char *keywords[] = { "encoding", "errors", "length", NULL };
if (!PyArg_ParseTupleAndKeywords (args, kw, "|ssi", keywords,
&user_encoding, &errors, &length))