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
8ec3d88f
Commit
8ec3d88f
authored
Dec 24, 2015
by
Yong Li
Committed by
Edward Thomson
Apr 11, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Avoid subtraction overflow in git_indexer_commit
parent
4a93a7fc
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
2 deletions
+7
-2
src/indexer.c
+7
-2
No files found.
src/indexer.c
View file @
8ec3d88f
...
...
@@ -914,12 +914,17 @@ int git_indexer_commit(git_indexer *idx, git_transfer_progress *stats)
git_filebuf
index_file
=
{
0
};
void
*
packfile_trailer
;
if
(
!
idx
->
parsed_header
)
{
giterr_set
(
GITERR_INDEXER
,
"incomplete pack header"
);
return
-
1
;
}
if
(
git_hash_ctx_init
(
&
ctx
)
<
0
)
return
-
1
;
/* Test for this before resolve_deltas(), as it plays with idx->off */
if
(
idx
->
off
<
idx
->
pack
->
mwf
.
size
-
20
)
{
giterr_set
(
GITERR_INDEXER
,
"
U
nexpected data at the end of the pack"
);
if
(
idx
->
off
+
20
<
idx
->
pack
->
mwf
.
size
)
{
giterr_set
(
GITERR_INDEXER
,
"
u
nexpected data at the end of the pack"
);
return
-
1
;
}
...
...
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