This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[python][patch] Do not allow invalid/illegal subscripts on values


This patches fixes illegal subscripts performed on gdb values through Python. The discussion regarding the invalid subscripts is referenced here:

http://permalink.gmane.org/gmane.comp.gdb.devel/26807

This patch checks the value type before allowing a subscript operation to proceed. It also adds some regressions and general tests for value subscripts.

This patch was tested on x86-64, and causes no regressions.

OK?

Regards

Phil

--

ChangeLog

2009-09-16 Phil Muldoon <pmuldoon@redhat.com>

    * py-value.c (valpy_getitem): Test value before allowing subscript
    operation.

Testsuite ChangeLog

2009-09-16 Phil Muldoon <pmuldoon@redhat.com>

    * gdb.python/py-value.exp (test_subscript_regression): New
    function.  Test for invalid subscripts.
    * gdb.python/py-value.c (main): Add test array, and pointer to it.
    (ptr_ref): New function.

--



Attachment: py_subscript-cvs.patch
Description: Text document


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]