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
1c72acf2
Commit
1c72acf2
authored
Jun 27, 2015
by
Benjamin Peterson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ensure internal buffer is large enough for string after flushing (closes #24481)
parent
1ecb5ce7
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
0 deletions
+11
-0
Lib/test/test_hotshot.py
Lib/test/test_hotshot.py
+4
-0
Misc/NEWS
Misc/NEWS
+3
-0
Modules/_hotshot.c
Modules/_hotshot.c
+4
-0
No files found.
Lib/test/test_hotshot.py
View file @
1c72acf2
...
...
@@ -149,6 +149,10 @@ class HotShotTestCase(unittest.TestCase):
stats
.
load
(
self
.
logfn
)
os
.
unlink
(
self
.
logfn
)
def
test_large_info
(
self
):
p
=
self
.
new_profiler
()
self
.
assertRaises
(
ValueError
,
p
.
addinfo
,
"A"
,
"A"
*
0xfceb
)
def
test_main
():
test_support
.
run_unittest
(
HotShotTestCase
)
...
...
Misc/NEWS
View file @
1c72acf2
...
...
@@ -30,6 +30,9 @@ Core and Builtins
Library
-------
- Issue #24481: Fix possible memory corruption with large profiler info strings
in hotshot.
- Issue #24489: ensure a previously set C errno doesn'
t
disturb
cmath
.
polar
().
-
Issue
#
19543
:
io
.
TextIOWrapper
(
and
hence
io
.
open
())
now
uses
the
internal
...
...
Modules/_hotshot.c
View file @
1c72acf2
...
...
@@ -626,6 +626,10 @@ pack_string(ProfilerObject *self, const char *s, Py_ssize_t len)
if
(
len
+
PISIZE
+
self
->
index
>=
BUFFERSIZE
)
{
if
(
flush_data
(
self
)
<
0
)
return
-
1
;
if
(
len
+
PISIZE
+
self
->
index
>=
BUFFERSIZE
)
{
PyErr_SetString
(
PyExc_ValueError
,
"string too large for internal buffer"
);
return
-
1
;
}
}
assert
(
len
<
INT_MAX
);
if
(
pack_packed_int
(
self
,
(
int
)
len
)
<
0
)
...
...
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