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
b05c0738
Commit
b05c0738
authored
May 15, 2012
by
Martin v. Löwis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Silence VS 2010 signed/unsigned warnings.
parent
6ecf8ce3
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
2 deletions
+5
-2
Objects/unicodeobject.c
Objects/unicodeobject.c
+5
-2
No files found.
Objects/unicodeobject.c
View file @
b05c0738
...
@@ -13591,7 +13591,10 @@ PyUnicode_Format(PyObject *format, PyObject *args)
...
@@ -13591,7 +13591,10 @@ PyUnicode_Format(PyObject *format, PyObject *args)
c
=
PyUnicode_READ
(
fmtkind
,
fmt
,
fmtpos
++
);
c
=
PyUnicode_READ
(
fmtkind
,
fmt
,
fmtpos
++
);
if
(
c
<
'0'
||
c
>
'9'
)
if
(
c
<
'0'
||
c
>
'9'
)
break
;
break
;
if
(
width
>
(
PY_SSIZE_T_MAX
-
(
c
-
'0'
))
/
10
)
{
/* Since c is unsigned, the RHS would end up as unsigned,
mixing signed and unsigned comparison. Since c is between
'0' and '9', casting to int is safe. */
if
(
width
>
(
PY_SSIZE_T_MAX
-
((
int
)
c
-
'0'
))
/
10
)
{
PyErr_SetString
(
PyExc_ValueError
,
PyErr_SetString
(
PyExc_ValueError
,
"width too big"
);
"width too big"
);
goto
onError
;
goto
onError
;
...
@@ -13626,7 +13629,7 @@ PyUnicode_Format(PyObject *format, PyObject *args)
...
@@ -13626,7 +13629,7 @@ PyUnicode_Format(PyObject *format, PyObject *args)
c
=
PyUnicode_READ
(
fmtkind
,
fmt
,
fmtpos
++
);
c
=
PyUnicode_READ
(
fmtkind
,
fmt
,
fmtpos
++
);
if
(
c
<
'0'
||
c
>
'9'
)
if
(
c
<
'0'
||
c
>
'9'
)
break
;
break
;
if
(
prec
>
(
INT_MAX
-
(
c
-
'0'
))
/
10
)
{
if
(
prec
>
(
INT_MAX
-
(
(
int
)
c
-
'0'
))
/
10
)
{
PyErr_SetString
(
PyExc_ValueError
,
PyErr_SetString
(
PyExc_ValueError
,
"prec too big"
);
"prec too big"
);
goto
onError
;
goto
onError
;
...
...
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