summaryrefslogtreecommitdiffstats
path: root/PC/config.h
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>2000-05-08 14:08:05 (GMT)
committerGuido van Rossum <guido@python.org>2000-05-08 14:08:05 (GMT)
commitc682140de7656db69b9d395c1a80f1b429ef0ae7 (patch)
tree70d5257b81111a2ef6de94f5760cbe7925b7f6d3 /PC/config.h
parent20c6add7ff268340797cc8a038a79417e98a7a8c (diff)
downloadcpython-c682140de7656db69b9d395c1a80f1b429ef0ae7.zip
cpython-c682140de7656db69b9d395c1a80f1b429ef0ae7.tar.gz
cpython-c682140de7656db69b9d395c1a80f1b429ef0ae7.tar.bz2
Trent Mick:
Fix the string methods that implement slice-like semantics with optional args (count, find, endswith, etc.) to properly handle indeces outside [INT_MIN, INT_MAX]. Previously the "i" formatter for PyArg_ParseTuple was used to get the indices. These could overflow. This patch changes the string methods to use the "O&" formatter with the slice_index() function from ceval.c which is used to do the same job for Python code slices (e.g. 'abcabcabc'[0:1000000000L]). slice_index() is renamed _PyEval_SliceIndex() and is now exported. As well, the return values for success/fail were changed to make slice_index directly usable as required by the "O&" formatter. [GvR: shouldn't a similar patch be applied to unicodeobject.c?]
Diffstat (limited to 'PC/config.h')
0 files changed, 0 insertions, 0 deletions