mirror of
https://github.com/python/cpython.git
synced 2025-10-23 07:02:24 +00:00
merge 3.2
This commit is contained in:
commit
156285c35f
4 changed files with 12 additions and 1 deletions
|
@ -70,5 +70,9 @@ class TestDecode:
|
||||||
msg = 'escape'
|
msg = 'escape'
|
||||||
self.assertRaisesRegex(ValueError, msg, self.loads, s)
|
self.assertRaisesRegex(ValueError, msg, self.loads, s)
|
||||||
|
|
||||||
|
def test_negative_index(self):
|
||||||
|
d = self.json.JSONDecoder()
|
||||||
|
self.assertRaises(ValueError, d.raw_decode, 'a'*42, -50000)
|
||||||
|
|
||||||
class TestPyDecode(TestDecode, PyTest): pass
|
class TestPyDecode(TestDecode, PyTest): pass
|
||||||
class TestCDecode(TestDecode, CTest): pass
|
class TestCDecode(TestDecode, CTest): pass
|
||||||
|
|
|
@ -1313,6 +1313,7 @@ Johannes Vogel
|
||||||
Alex Volkov
|
Alex Volkov
|
||||||
Martijn Vries
|
Martijn Vries
|
||||||
Sjoerd de Vries
|
Sjoerd de Vries
|
||||||
|
Guido Vranken
|
||||||
Niki W. Waibel
|
Niki W. Waibel
|
||||||
Wojtek Walczak
|
Wojtek Walczak
|
||||||
Charles Waldman
|
Charles Waldman
|
||||||
|
|
|
@ -13,6 +13,9 @@ Core and Builtins
|
||||||
Library
|
Library
|
||||||
-------
|
-------
|
||||||
|
|
||||||
|
- Fix arbitrary memory access in JSONDecoder.raw_decode with a negative second
|
||||||
|
parameter. Bug reported by Guido Vranken.
|
||||||
|
|
||||||
- Issue #20633: Replace relative import by absolute import.
|
- Issue #20633: Replace relative import by absolute import.
|
||||||
|
|
||||||
- Issue #21082: In os.makedirs, do not set the process-wide umask. Note this
|
- Issue #21082: In os.makedirs, do not set the process-wide umask. Note this
|
||||||
|
|
|
@ -975,7 +975,10 @@ scan_once_unicode(PyScannerObject *s, PyObject *pystr, Py_ssize_t idx, Py_ssize_
|
||||||
kind = PyUnicode_KIND(pystr);
|
kind = PyUnicode_KIND(pystr);
|
||||||
length = PyUnicode_GET_LENGTH(pystr);
|
length = PyUnicode_GET_LENGTH(pystr);
|
||||||
|
|
||||||
if (idx >= length) {
|
if (idx < 0)
|
||||||
|
/* Compatibility with Python version. */
|
||||||
|
idx += length;
|
||||||
|
if (idx < 0 || idx >= length) {
|
||||||
PyErr_SetNone(PyExc_StopIteration);
|
PyErr_SetNone(PyExc_StopIteration);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue