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
17ef7dbc
Commit
17ef7dbc
authored
May 31, 2013
by
Vicent Martí
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1626 from ethomson/index_ext_truncation
improve test for index extension truncation
parents
8d863aa2
8c2458be
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
2 deletions
+3
-2
src/index.c
+3
-2
No files found.
src/index.c
View file @
17ef7dbc
...
...
@@ -1575,7 +1575,8 @@ static size_t read_extension(git_index *index, const char *buffer, size_t buffer
total_size
=
dest
.
extension_size
+
sizeof
(
struct
index_extension
);
if
(
buffer_size
-
total_size
<
INDEX_FOOTER_SIZE
)
if
(
buffer_size
<
total_size
||
buffer_size
-
total_size
<
INDEX_FOOTER_SIZE
)
return
0
;
/* optional extension */
...
...
@@ -1661,7 +1662,7 @@ static int parse_index(git_index *index, const char *buffer, size_t buffer_size)
/* see if we have read any bytes from the extension */
if
(
extension_size
==
0
)
return
index_error_invalid
(
"extension
size is zero
"
);
return
index_error_invalid
(
"extension
is truncated
"
);
seek_forward
(
extension_size
);
}
...
...
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