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
8e9bfa4c
Commit
8e9bfa4c
authored
Sep 27, 2011
by
Vicent Marti
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tree: Fix check for valid attributes
parent
9ef9e8c3
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
2 deletions
+4
-2
src/tree.c
+4
-2
No files found.
src/tree.c
View file @
8e9bfa4c
...
...
@@ -15,7 +15,8 @@
#define MAX_FILEMODE 0777777
#define MAX_FILEMODE_BYTES 6
static
int
valid_attributes
(
const
int
attributes
)
{
static
int
valid_attributes
(
const
int
attributes
)
{
return
attributes
>=
0
&&
attributes
<=
MAX_FILEMODE
;
}
...
...
@@ -169,8 +170,9 @@ static int tree_parse_buffer(git_tree *tree, const char *buffer, const char *buf
return
GIT_ENOMEM
;
if
(
git__strtol32
(
&
tmp
,
buffer
,
&
buffer
,
8
)
<
GIT_SUCCESS
||
!
buffer
||
tmp
>
UINT_MAX
||
tmp
<
0
)
!
buffer
||
!
valid_attributes
(
tmp
)
)
return
git__throw
(
GIT_EOBJCORRUPTED
,
"Failed to parse tree. Can't parse attributes"
);
entry
->
attr
=
tmp
;
if
(
*
buffer
++
!=
' '
)
{
...
...
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