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
9745ee0b
Commit
9745ee0b
authored
Aug 13, 2016
by
Benjamin Peterson
Browse files
Options
Browse Files
Download
Plain Diff
merge 3.4 (closes #27758)
parents
689016fc
59b6abd3
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
4 deletions
+22
-4
Misc/NEWS
Misc/NEWS
+3
-0
Modules/_csv.c
Modules/_csv.c
+19
-4
No files found.
Misc/NEWS
View file @
9745ee0b
...
...
@@ -37,6 +37,9 @@ Library
-
Issue
#
26750
:
unittest
.
mock
.
create_autospec
()
now
works
properly
for
subclasses
of
property
()
and
other
data
descriptors
.
-
Issue
#
27758
:
Fix
possible
integer
overflow
in
the
_csv
module
for
large
record
lengths
.
-
Issue
#
27568
:
Prevent
HTTPoxy
attack
(
CVE
-
2016
-
1000110
).
Ignore
the
HTTP_PROXY
variable
when
REQUEST_METHOD
environment
is
set
,
which
indicates
that
the
script
is
in
CGI
mode
.
...
...
Modules/_csv.c
View file @
9745ee0b
...
...
@@ -1014,11 +1014,19 @@ join_append_data(WriterObj *self, unsigned int field_kind, void *field_data,
int
i
;
Py_ssize_t
rec_len
;
#define ADDCH(c) \
#define INCLEN \
do {\
if (!copy_phase && rec_len == PY_SSIZE_T_MAX) { \
goto overflow; \
} \
rec_len++; \
} while(0)
#define ADDCH(c) \
do {\
if (copy_phase) \
self->rec[rec_len] = c;\
rec_len++
;\
INCLEN
;\
} while(0)
rec_len
=
self
->
rec_len
;
...
...
@@ -1072,11 +1080,18 @@ join_append_data(WriterObj *self, unsigned int field_kind, void *field_data,
if
(
*
quoted
)
{
if
(
copy_phase
)
ADDCH
(
dialect
->
quotechar
);
else
rec_len
+=
2
;
else
{
INCLEN
;
/* starting quote */
INCLEN
;
/* ending quote */
}
}
return
rec_len
;
overflow:
PyErr_NoMemory
();
return
-
1
;
#undef ADDCH
#undef INCLEN
}
static
int
...
...
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