[Python-checkins] cpython: Issue #16147: PyUnicode_FromFormatV() now raises an error if the argument of
victor.stinner
python-checkins at python.org
Sat Oct 6 23:18:33 CEST 2012
http://hg.python.org/cpython/rev/5e319fdab563
changeset: 79544:5e319fdab563
user: Victor Stinner <victor.stinner at gmail.com>
date: Sat Oct 06 23:05:45 2012 +0200
summary:
Issue #16147: PyUnicode_FromFormatV() now raises an error if the argument of
'%c' is not in the range(0x110000).
files:
Objects/unicodeobject.c | 5 +++++
1 files changed, 5 insertions(+), 0 deletions(-)
diff --git a/Objects/unicodeobject.c b/Objects/unicodeobject.c
--- a/Objects/unicodeobject.c
+++ b/Objects/unicodeobject.c
@@ -2417,6 +2417,11 @@
case 'c':
{
int ordinal = va_arg(*vargs, int);
+ if (ordinal < 0 || ordinal > MAX_UNICODE) {
+ PyErr_SetString(PyExc_ValueError,
+ "character argument not in range(0x110000)");
+ return NULL;
+ }
if (_PyUnicodeWriter_Prepare(writer, 1, ordinal) == -1)
return NULL;
PyUnicode_WRITE(writer->kind, writer->data, writer->pos, ordinal);
--
Repository URL: http://hg.python.org/cpython
More information about the Python-checkins
mailing list