mirror of
https://github.com/python/cpython.git
synced 2025-12-15 21:44:50 +00:00
[security] bpo-13617: Reject embedded null characters in wchar* strings. (#2302)
Based on patch by Victor Stinner. Add private C API function _PyUnicode_AsUnicode() which is similar to PyUnicode_AsUnicode(), but checks for null characters.
This commit is contained in:
parent
592eda1233
commit
f7eae0adfc
22 changed files with 115 additions and 23 deletions
|
|
@ -50,6 +50,8 @@ class GroupDatabaseTestCase(unittest.TestCase):
|
|||
self.assertRaises(TypeError, grp.getgrgid)
|
||||
self.assertRaises(TypeError, grp.getgrnam)
|
||||
self.assertRaises(TypeError, grp.getgrall, 42)
|
||||
# embedded null character
|
||||
self.assertRaises(ValueError, grp.getgrnam, 'a\x00b')
|
||||
|
||||
# try to get some errors
|
||||
bynames = {}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue