summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@gmail.com>2013-03-06 00:39:03 +0100
committerVictor Stinner <victor.stinner@gmail.com>2013-03-06 00:39:03 +0100
commite5c0533b5887fae64df7bf0d69a307f0a63c77e5 (patch)
treec92d86dc211f8f51b08cda4cd7eea39d24c957e1
parent87a249c1196bcdc09201f5b3c60ae13ecc62cbe1 (diff)
downloadcpython-git-e5c0533b5887fae64df7bf0d69a307f0a63c77e5.tar.gz
Issue #17223: Add another test to check that _PyUnicode_Ready() rejects
code points bigger than U+10ffff
-rw-r--r--Modules/_testcapimodule.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/Modules/_testcapimodule.c b/Modules/_testcapimodule.c
index 2f4381363a..7f640bce25 100644
--- a/Modules/_testcapimodule.c
+++ b/Modules/_testcapimodule.c
@@ -1418,6 +1418,16 @@ test_widechar(PyObject *self)
else
return raiseTestError("test_widechar",
"PyUnicode_FromUnicode(L\"\\U00110000\", 1) didn't fail");
+
+ wide = PyUnicode_FromUnicode(NULL, 1);
+ if (wide == NULL)
+ return NULL;
+ PyUnicode_AS_UNICODE(wide)[0] = invalid[0];
+ if (_PyUnicode_Ready(wide) < 0)
+ PyErr_Clear();
+ else
+ return raiseTestError("test_widechar",
+ "PyUnicode_Ready() didn't fail");
#endif
Py_RETURN_NONE;