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
17ef678c
Commit
17ef678c
authored
Apr 21, 2014
by
Russell Belfer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix some coverity-found issues
parent
28750a7d
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
16 additions
and
18 deletions
+16
-18
src/attr_file.c
+6
-7
src/attrcache.c
+4
-6
src/ignore.c
+3
-3
src/index.c
+3
-2
No files found.
src/attr_file.c
View file @
17ef678c
...
...
@@ -232,15 +232,14 @@ int git_attr_file__parse_buffer(
while
(
!
error
&&
*
scan
)
{
/* allocate rule if needed */
if
(
!
rule
)
{
if
(
!
(
rule
=
git__calloc
(
1
,
sizeof
(
*
rule
))))
{
error
=
-
1
;
break
;
}
rule
->
match
.
flags
=
GIT_ATTR_FNMATCH_ALLOWNEG
|
GIT_ATTR_FNMATCH_ALLOWMACRO
;
if
(
!
rule
&&
!
(
rule
=
git__calloc
(
1
,
sizeof
(
*
rule
))))
{
error
=
-
1
;
break
;
}
rule
->
match
.
flags
=
GIT_ATTR_FNMATCH_ALLOWNEG
|
GIT_ATTR_FNMATCH_ALLOWMACRO
;
/* parse the next "pattern attr attr attr" line */
if
(
!
(
error
=
git_attr_fnmatch__parse
(
&
rule
->
match
,
&
attrs
->
pool
,
context
,
&
scan
))
&&
...
...
src/attrcache.c
View file @
17ef678c
...
...
@@ -176,10 +176,9 @@ static int attr_cache_lookup(
goto
cleanup
;
entry
=
attr_cache_lookup_entry
(
cache
,
relfile
);
if
(
!
entry
)
{
if
((
error
=
attr_cache_make_entry
(
&
entry
,
repo
,
relfile
))
<
0
)
goto
cleanup
;
}
else
if
(
entry
->
file
[
source
]
!=
NULL
)
{
if
(
!
entry
)
error
=
attr_cache_make_entry
(
&
entry
,
repo
,
relfile
);
else
if
(
entry
->
file
[
source
]
!=
NULL
)
{
file
=
entry
->
file
[
source
];
GIT_REFCOUNT_INC
(
file
);
}
...
...
@@ -254,8 +253,7 @@ bool git_attr_cache__is_cached(
khiter_t
pos
;
git_attr_file_entry
*
entry
;
if
(
!
(
cache
=
git_repository_attr_cache
(
repo
))
||
!
(
files
=
cache
->
files
))
if
(
!
cache
||
!
(
files
=
cache
->
files
))
return
false
;
pos
=
git_strmap_lookup_index
(
files
,
filename
);
...
...
src/ignore.c
View file @
17ef678c
...
...
@@ -32,9 +32,9 @@ static int parse_ignore_file(
}
while
(
!
error
&&
*
scan
)
{
if
(
!
match
)
{
match
=
git__calloc
(
1
,
sizeof
(
*
match
))
;
GITERR_CHECK_ALLOC
(
match
)
;
if
(
!
match
&&
!
(
match
=
git__calloc
(
1
,
sizeof
(
*
match
)))
)
{
error
=
-
1
;
break
;
}
match
->
flags
=
GIT_ATTR_FNMATCH_ALLOWSPACE
|
GIT_ATTR_FNMATCH_ALLOWNEG
;
...
...
src/index.c
View file @
17ef678c
...
...
@@ -1880,8 +1880,9 @@ static int parse_index(git_index *index, const char *buffer, size_t buffer_size)
git_oid
checksum_calculated
,
checksum_expected
;
#define seek_forward(_increase) { \
if (_increase >= buffer_size) \
return index_error_invalid("ran out of data while parsing"); \
if (_increase >= buffer_size) { \
error = index_error_invalid("ran out of data while parsing"); \
goto done; } \
buffer += _increase; \
buffer_size -= _increase;\
}
...
...
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