Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
F
folly
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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Libraries
folly
Commits
6e442037
Commit
6e442037
authored
Sep 10, 2013
by
Philip Pronin
Committed by
Jordan DeLong
Sep 22, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix memcpy-param-overlap (asan) in GroupVarint
Test Plan: . Reviewed By: tudorb@fb.com FB internal diff: D962972
parent
95201d11
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
3 deletions
+7
-3
folly/GroupVarint.h
folly/GroupVarint.h
+7
-3
No files found.
folly/GroupVarint.h
View file @
6e442037
...
...
@@ -509,15 +509,17 @@ class GroupVarintDecoder {
:
rrest_
(
data
.
end
()),
p_
(
data
.
data
()),
end_
(
data
.
end
()),
limit_
(
end_
),
pos_
(
0
),
count_
(
0
),
remaining_
(
maxCount
)
{
}
void
reset
(
StringPiece
data
,
size_t
maxCount
=
(
size_t
)
-
1
)
{
void
reset
(
StringPiece
data
,
size_t
maxCount
=
(
size_t
)
-
1
)
{
rrest_
=
data
.
end
();
p_
=
data
.
data
();
end_
=
data
.
end
();
limit_
=
end_
;
pos_
=
0
;
count_
=
0
;
remaining_
=
maxCount
;
...
...
@@ -540,10 +542,11 @@ class GroupVarintDecoder {
// The best way to ensure this is to ensure that data has at least
// Base::kMaxSize - 1 bytes readable *after* the end, otherwise we'll copy
// into a temporary buffer.
if
(
rem
<
Base
::
kMaxSize
)
{
if
(
limit_
-
p_
<
Base
::
kMaxSize
)
{
memcpy
(
tmp_
,
p_
,
rem
);
p_
=
tmp_
;
end_
=
p_
+
rem
;
limit_
=
tmp_
+
sizeof
(
tmp_
);
}
pos_
=
0
;
const
char
*
n
=
Base
::
decode
(
p_
,
buf_
);
...
...
@@ -591,7 +594,8 @@ class GroupVarintDecoder {
const
char
*
rrest_
;
const
char
*
p_
;
const
char
*
end_
;
char
tmp_
[
Base
::
kMaxSize
];
const
char
*
limit_
;
char
tmp_
[
2
*
Base
::
kMaxSize
];
type
buf_
[
Base
::
kGroupSize
];
size_t
pos_
;
size_t
count_
;
...
...
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