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
89bd4ddb
Commit
89bd4ddb
authored
Jan 21, 2019
by
Edward Thomson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
diff_generate: validate oid file size
Index entries are 32 bit unsigned ints, not `size_t`s.
parent
fd9d4e28
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
+2
-2
src/diff_generate.c
+2
-2
No files found.
src/diff_generate.c
View file @
89bd4ddb
...
...
@@ -564,14 +564,14 @@ int git_diff__oid_for_file(
{
git_index_entry
entry
;
if
(
!
git__is_sizet
(
size
)
)
{
if
(
size
<
0
||
size
>
UINT32_MAX
)
{
git_error_set
(
GIT_ERROR_NOMEMORY
,
"file size overflow (for 32-bits) on '%s'"
,
path
);
return
-
1
;
}
memset
(
&
entry
,
0
,
sizeof
(
entry
));
entry
.
mode
=
mode
;
entry
.
file_size
=
(
size
_t
)
size
;
entry
.
file_size
=
(
uint32
_t
)
size
;
entry
.
path
=
(
char
*
)
path
;
return
git_diff__oid_for_entry
(
out
,
diff
,
&
entry
,
mode
,
NULL
);
...
...
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