mirror of
https://github.com/python/cpython.git
synced 2025-08-19 00:00:48 +00:00
Merged revisions 74167 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk ........ r74167 | georg.brandl | 2009-07-22 13:57:15 +0200 (Mi, 22 Jul 2009) | 1 line Issue #6540: Fixed crash for bytearray.translate() with invalid parameters. ........
This commit is contained in:
parent
087d1a6d4b
commit
11a81b2151
3 changed files with 11 additions and 5 deletions
|
@ -1458,15 +1458,14 @@ bytes_translate(PyByteArrayObject *self, PyObject *args)
|
|||
if (vtable.len != 256) {
|
||||
PyErr_SetString(PyExc_ValueError,
|
||||
"translation table must be 256 characters long");
|
||||
result = NULL;
|
||||
goto done;
|
||||
PyBuffer_Release(&vtable);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (delobj != NULL) {
|
||||
if (_getbuffer(delobj, &vdel) < 0) {
|
||||
result = NULL;
|
||||
delobj = NULL; /* don't try to release vdel buffer on exit */
|
||||
goto done;
|
||||
PyBuffer_Release(&vtable);
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
else {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue