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
7e53e8ce
Commit
7e53e8ce
authored
Mar 22, 2017
by
Edward Thomson
Committed by
GitHub
Mar 22, 2017
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #4167 from pks-t/pks/ci-fixes
Coverity fixes
parents
69d0b460
e7330016
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
26 additions
and
12 deletions
+26
-12
src/blame_git.c
+9
-5
src/config_file.c
+8
-2
src/diff_parse.c
+5
-1
src/odb_pack.c
+1
-1
src/openssl_stream.c
+1
-1
src/patch_parse.c
+2
-2
No files found.
src/blame_git.c
View file @
7e53e8ce
...
...
@@ -478,14 +478,15 @@ cleanup:
* The blobs of origin and porigin exactly match, so everything origin is
* suspected for can be blamed on the parent.
*/
static
void
pass_whole_blame
(
git_blame
*
blame
,
static
int
pass_whole_blame
(
git_blame
*
blame
,
git_blame__origin
*
origin
,
git_blame__origin
*
porigin
)
{
git_blame__entry
*
e
;
if
(
!
porigin
->
blob
)
git_object_lookup
((
git_object
**
)
&
porigin
->
blob
,
blame
->
repository
,
git_blob_id
(
origin
->
blob
),
GIT_OBJ_BLOB
);
if
(
!
porigin
->
blob
&&
git_object_lookup
((
git_object
**
)
&
porigin
->
blob
,
blame
->
repository
,
git_blob_id
(
origin
->
blob
),
GIT_OBJ_BLOB
)
<
0
)
return
-
1
;
for
(
e
=
blame
->
ent
;
e
;
e
=
e
->
next
)
{
if
(
!
same_suspect
(
e
->
suspect
,
origin
))
continue
;
...
...
@@ -493,6 +494,8 @@ static void pass_whole_blame(git_blame *blame,
origin_decref
(
e
->
suspect
);
e
->
suspect
=
porigin
;
}
return
0
;
}
static
int
pass_blame
(
git_blame
*
blame
,
git_blame__origin
*
origin
,
uint32_t
opt
)
...
...
@@ -543,7 +546,8 @@ static int pass_blame(git_blame *blame, git_blame__origin *origin, uint32_t opt)
}
if
(
porigin
->
blob
&&
origin
->
blob
&&
!
git_oid_cmp
(
git_blob_id
(
porigin
->
blob
),
git_blob_id
(
origin
->
blob
)))
{
pass_whole_blame
(
blame
,
origin
,
porigin
);
error
=
pass_whole_blame
(
blame
,
origin
,
porigin
);
goto
finish
;
origin_decref
(
porigin
);
goto
finish
;
}
...
...
src/config_file.c
View file @
7e53e8ce
...
...
@@ -1041,8 +1041,9 @@ static int parse_section_header_ext(struct reader *reader, const char *line, con
GITERR_CHECK_ALLOC_ADD
(
&
alloc_len
,
base_name_len
,
quoted_len
);
GITERR_CHECK_ALLOC_ADD
(
&
alloc_len
,
alloc_len
,
2
);
git_buf_grow
(
&
buf
,
alloc_len
);
git_buf_printf
(
&
buf
,
"%s."
,
base_name
);
if
(
git_buf_grow
(
&
buf
,
alloc_len
)
<
0
||
git_buf_printf
(
&
buf
,
"%s."
,
base_name
)
<
0
)
goto
end_parse
;
rpos
=
0
;
...
...
@@ -1082,6 +1083,11 @@ static int parse_section_header_ext(struct reader *reader, const char *line, con
}
while
(
line
+
rpos
<
last_quote
);
end_parse
:
if
(
git_buf_oom
(
&
buf
))
{
git_buf_free
(
&
buf
);
return
-
1
;
}
if
(
line
[
rpos
]
!=
'"'
||
line
[
rpos
+
1
]
!=
']'
)
{
set_parse_error
(
reader
,
rpos
,
"Unexpected text after closing quotes"
);
git_buf_free
(
&
buf
);
...
...
src/diff_parse.c
View file @
7e53e8ce
...
...
@@ -44,7 +44,11 @@ static git_diff_parsed *diff_parsed_alloc(void)
diff
->
base
.
patch_fn
=
git_patch_parsed_from_diff
;
diff
->
base
.
free_fn
=
diff_parsed_free
;
git_diff_init_options
(
&
diff
->
base
.
opts
,
GIT_DIFF_OPTIONS_VERSION
);
if
(
git_diff_init_options
(
&
diff
->
base
.
opts
,
GIT_DIFF_OPTIONS_VERSION
)
<
0
)
{
git__free
(
&
diff
);
return
NULL
;
}
diff
->
base
.
opts
.
flags
&=
~
GIT_DIFF_IGNORE_CASE
;
git_pool_init
(
&
diff
->
base
.
pool
,
1
);
...
...
src/odb_pack.c
View file @
7e53e8ce
...
...
@@ -428,7 +428,7 @@ static int pack_backend__read_prefix(
git_oid_cpy
(
out_oid
,
short_oid
);
}
else
{
struct
git_pack_entry
e
;
git_rawobj
raw
;
git_rawobj
raw
=
{
NULL
}
;
if
((
error
=
pack_entry_find_prefix
(
&
e
,
(
struct
pack_backend
*
)
backend
,
short_oid
,
len
))
==
0
&&
...
...
src/openssl_stream.c
View file @
7e53e8ce
...
...
@@ -66,7 +66,7 @@ static void shutdown_ssl_locking(void)
CRYPTO_set_locking_callback
(
NULL
);
for
(
i
=
0
;
i
<
num_locks
;
++
i
)
git_mutex_free
(
openssl_locks
);
git_mutex_free
(
&
openssl_locks
[
i
]
);
git__free
(
openssl_locks
);
}
...
...
src/patch_parse.c
View file @
7e53e8ce
...
...
@@ -444,9 +444,9 @@ static int parse_header_git(
goto
done
;
parse_advance_ws
(
ctx
);
parse_advance_expected_str
(
ctx
,
"
\n
"
);
if
(
ctx
->
line_len
>
0
)
{
if
(
parse_advance_expected_str
(
ctx
,
"
\n
"
)
<
0
||
ctx
->
line_len
>
0
)
{
error
=
parse_err
(
"trailing data at line %"
PRIuZ
,
ctx
->
line_num
);
goto
done
;
}
...
...
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