Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
da8e6a2d
Commit
da8e6a2d
authored
Jul 01, 2014
by
Victor Stinner
Browse files
Options
Browse Files
Download
Plain Diff
(Merge 3.4) Closes #21780: make the unicodedata module "ssize_t clean" for
parsing parameters
parents
7f084064
65a3144e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
2 deletions
+8
-2
Modules/unicodedata.c
Modules/unicodedata.c
+8
-2
No files found.
Modules/unicodedata.c
View file @
da8e6a2d
...
...
@@ -13,6 +13,8 @@
------------------------------------------------------------------------ */
#define PY_SSIZE_T_CLEAN
#include "Python.h"
#include "ucnhash.h"
#include "structmember.h"
...
...
@@ -1271,12 +1273,16 @@ unicodedata_lookup(PyObject* self, PyObject* args)
Py_UCS4
code
;
char
*
name
;
in
t
namelen
;
Py_ssize_
t
namelen
;
unsigned
int
index
;
if
(
!
PyArg_ParseTuple
(
args
,
"s#:lookup"
,
&
name
,
&
namelen
))
return
NULL
;
if
(
namelen
>
INT_MAX
)
{
PyErr_SetString
(
PyExc_KeyError
,
"name too long"
);
return
NULL
;
}
if
(
!
_getcode
(
self
,
name
,
namelen
,
&
code
,
1
))
{
if
(
!
_getcode
(
self
,
name
,
(
int
)
namelen
,
&
code
,
1
))
{
PyErr_Format
(
PyExc_KeyError
,
"undefined character name '%s'"
,
name
);
return
NULL
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment