Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
git2
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lvzhengyang
git2
Commits
0f07d54b
Commit
0f07d54b
authored
Feb 13, 2015
by
Edward Thomson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
pack-objects: unlock the cache on integer overflow
parent
d97d9559
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
4 deletions
+5
-4
src/pack-objects.c
+5
-4
No files found.
src/pack-objects.c
View file @
0f07d54b
...
@@ -832,13 +832,14 @@ static int try_delta(git_packbuilder *pb, struct unpacked *trg,
...
@@ -832,13 +832,14 @@ static int try_delta(git_packbuilder *pb, struct unpacked *trg,
trg_object
->
delta_data
=
NULL
;
trg_object
->
delta_data
=
NULL
;
}
}
if
(
delta_cacheable
(
pb
,
src_size
,
trg_size
,
delta_size
))
{
if
(
delta_cacheable
(
pb
,
src_size
,
trg_size
,
delta_size
))
{
if
(
git__add_uint64_overflow
(
&
pb
->
delta_cache_size
,
pb
->
delta_cache_size
,
delta_size
))
bool
overflow
=
git__add_uint64_overflow
(
return
-
1
;
&
pb
->
delta_cache_size
,
pb
->
delta_cache_size
,
delta_size
)
;
git_packbuilder__cache_unlock
(
pb
);
git_packbuilder__cache_unlock
(
pb
);
trg_object
->
delta_data
=
git__realloc
(
delta_buf
,
delta_size
);
if
(
overflow
||
GITERR_CHECK_ALLOC
(
trg_object
->
delta_data
);
!
(
trg_object
->
delta_data
=
git__realloc
(
delta_buf
,
delta_size
)))
return
-
1
;
}
else
{
}
else
{
/* create delta when writing the pack */
/* create delta when writing the pack */
git_packbuilder__cache_unlock
(
pb
);
git_packbuilder__cache_unlock
(
pb
);
...
...
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