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
db729803
Unverified
Commit
db729803
authored
Aug 30, 2021
by
Edward Thomson
Committed by
GitHub
Aug 30, 2021
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #6018 from libgit2/ethomson/fixups
Fixes from code analysis
parents
969a056c
ed0ea96e
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
29 additions
and
15 deletions
+29
-15
src/date.c
+1
-1
src/errors.c
+0
-5
src/filter.c
+2
-1
src/hashsig.c
+3
-1
src/midx.c
+7
-3
src/pack.c
+16
-3
src/transports/httpclient.c
+0
-1
No files found.
src/date.c
View file @
db729803
...
@@ -722,7 +722,7 @@ static const char *approxidate_alpha(const char *date, struct tm *tm, struct tm
...
@@ -722,7 +722,7 @@ static const char *approxidate_alpha(const char *date, struct tm *tm, struct tm
while
(
tl
->
type
)
{
while
(
tl
->
type
)
{
size_t
len
=
strlen
(
tl
->
type
);
size_t
len
=
strlen
(
tl
->
type
);
if
(
match_string
(
date
,
tl
->
type
)
>=
len
-
1
)
{
if
(
match_string
(
date
,
tl
->
type
)
>=
len
-
1
)
{
update_tm
(
tm
,
now
,
tl
->
length
*
*
num
);
update_tm
(
tm
,
now
,
tl
->
length
*
(
unsigned
long
)
*
num
);
*
num
=
0
;
*
num
=
0
;
*
touched
=
1
;
*
touched
=
1
;
return
end
;
return
end
;
...
...
src/errors.c
View file @
db729803
...
@@ -107,11 +107,6 @@ int git_error_set_str(int error_class, const char *string)
...
@@ -107,11 +107,6 @@ int git_error_set_str(int error_class, const char *string)
GIT_ASSERT_ARG
(
string
);
GIT_ASSERT_ARG
(
string
);
if
(
!
string
)
{
git_error_set
(
GIT_ERROR_INVALID
,
"unspecified caller error"
);
return
-
1
;
}
git_buf_clear
(
buf
);
git_buf_clear
(
buf
);
git_buf_puts
(
buf
,
string
);
git_buf_puts
(
buf
,
string
);
...
...
src/filter.c
View file @
db729803
...
@@ -206,7 +206,8 @@ int git_filter_global_init(void)
...
@@ -206,7 +206,8 @@ int git_filter_global_init(void)
GIT_FILTER_IDENT
,
ident
,
GIT_FILTER_IDENT_PRIORITY
)
<
0
)
GIT_FILTER_IDENT
,
ident
,
GIT_FILTER_IDENT_PRIORITY
)
<
0
)
error
=
-
1
;
error
=
-
1
;
error
=
git_runtime_shutdown_register
(
git_filter_global_shutdown
);
if
(
!
error
)
error
=
git_runtime_shutdown_register
(
git_filter_global_shutdown
);
done:
done:
if
(
error
)
{
if
(
error
)
{
...
...
src/hashsig.c
View file @
db729803
...
@@ -286,8 +286,10 @@ int git_hashsig_create_fromfile(
...
@@ -286,8 +286,10 @@ int git_hashsig_create_fromfile(
return
fd
;
return
fd
;
}
}
if
((
error
=
hashsig_in_progress_init
(
&
prog
,
sig
))
<
0
)
if
((
error
=
hashsig_in_progress_init
(
&
prog
,
sig
))
<
0
)
{
p_close
(
fd
);
return
error
;
return
error
;
}
while
(
!
error
)
{
while
(
!
error
)
{
if
((
buflen
=
p_read
(
fd
,
buf
,
sizeof
(
buf
)))
<=
0
)
{
if
((
buflen
=
p_read
(
fd
,
buf
,
sizeof
(
buf
)))
<=
0
)
{
...
...
src/midx.c
View file @
db729803
...
@@ -714,8 +714,10 @@ static int midx_write(
...
@@ -714,8 +714,10 @@ static int midx_write(
error
=
git_vector_init
(
&
object_entries
,
git_array_size
(
object_entries_array
),
object_entry__cmp
);
error
=
git_vector_init
(
&
object_entries
,
git_array_size
(
object_entries_array
),
object_entry__cmp
);
if
(
error
<
0
)
if
(
error
<
0
)
goto
cleanup
;
goto
cleanup
;
git_array_foreach
(
object_entries_array
,
i
,
entry
)
git_array_foreach
(
object_entries_array
,
i
,
entry
)
{
error
=
git_vector_set
(
NULL
,
&
object_entries
,
i
,
entry
);
if
((
error
=
git_vector_set
(
NULL
,
&
object_entries
,
i
,
entry
))
<
0
)
goto
cleanup
;
}
git_vector_set_sorted
(
&
object_entries
,
0
);
git_vector_set_sorted
(
&
object_entries
,
0
);
git_vector_sort
(
&
object_entries
);
git_vector_sort
(
&
object_entries
);
git_vector_uniq
(
&
object_entries
,
NULL
);
git_vector_uniq
(
&
object_entries
,
NULL
);
...
@@ -751,10 +753,12 @@ static int midx_write(
...
@@ -751,10 +753,12 @@ static int midx_write(
goto
cleanup
;
goto
cleanup
;
if
(
entry
->
offset
>=
0x80000000l
)
{
if
(
entry
->
offset
>=
0x80000000l
)
{
word
=
htonl
(
0x80000000u
|
object_large_offsets_count
++
);
word
=
htonl
(
0x80000000u
|
object_large_offsets_count
++
);
error
=
write_offset
(
entry
->
offset
,
midx_write_buf
,
&
object_large_offsets
);
if
((
error
=
write_offset
(
entry
->
offset
,
midx_write_buf
,
&
object_large_offsets
))
<
0
)
goto
cleanup
;
}
else
{
}
else
{
word
=
htonl
((
uint32_t
)
entry
->
offset
&
0x7fffffffu
);
word
=
htonl
((
uint32_t
)
entry
->
offset
&
0x7fffffffu
);
}
}
error
=
git_buf_put
(
&
object_offsets
,
(
const
char
*
)
&
word
,
sizeof
(
word
));
error
=
git_buf_put
(
&
object_offsets
,
(
const
char
*
)
&
word
,
sizeof
(
word
));
if
(
error
<
0
)
if
(
error
<
0
)
goto
cleanup
;
goto
cleanup
;
...
...
src/pack.c
View file @
db729803
...
@@ -1298,7 +1298,12 @@ int git_pack_foreach_entry(
...
@@ -1298,7 +1298,12 @@ int git_pack_foreach_entry(
return
error
;
return
error
;
}
}
GIT_ASSERT
(
p
->
index_map
.
data
);
if
(
!
p
->
index_map
.
data
)
{
git_error_set
(
GIT_ERROR_INTERNAL
,
"internal error: p->index_map.data == NULL"
);
git_mutex_unlock
(
&
p
->
lock
);
return
-
1
;
}
index
=
p
->
index_map
.
data
;
index
=
p
->
index_map
.
data
;
if
(
p
->
index_version
>
1
)
if
(
p
->
index_version
>
1
)
...
@@ -1387,7 +1392,11 @@ int git_pack_foreach_entry_offset(
...
@@ -1387,7 +1392,11 @@ int git_pack_foreach_entry_offset(
if
((
error
=
pack_index_open_locked
(
p
))
<
0
)
if
((
error
=
pack_index_open_locked
(
p
))
<
0
)
goto
cleanup
;
goto
cleanup
;
GIT_ASSERT
(
p
->
index_map
.
data
);
if
(
!
p
->
index_map
.
data
)
{
git_error_set
(
GIT_ERROR_INTERNAL
,
"internal error: p->index_map.data == NULL"
);
goto
cleanup
;
}
index
=
p
->
index_map
.
data
;
index
=
p
->
index_map
.
data
;
}
}
...
@@ -1479,7 +1488,11 @@ static int pack_entry_find_offset(
...
@@ -1479,7 +1488,11 @@ static int pack_entry_find_offset(
if
((
error
=
pack_index_open_locked
(
p
))
<
0
)
if
((
error
=
pack_index_open_locked
(
p
))
<
0
)
goto
cleanup
;
goto
cleanup
;
GIT_ASSERT
(
p
->
index_map
.
data
);
if
(
!
p
->
index_map
.
data
)
{
git_error_set
(
GIT_ERROR_INTERNAL
,
"internal error: p->index_map.data == NULL"
);
goto
cleanup
;
}
index
=
p
->
index_map
.
data
;
index
=
p
->
index_map
.
data
;
level1_ofs
=
p
->
index_map
.
data
;
level1_ofs
=
p
->
index_map
.
data
;
...
...
src/transports/httpclient.c
View file @
db729803
...
@@ -598,7 +598,6 @@ static int apply_credentials(
...
@@ -598,7 +598,6 @@ static int apply_credentials(
}
else
if
(
!
token
.
size
)
{
}
else
if
(
!
token
.
size
)
{
git_error_set
(
GIT_ERROR_HTTP
,
"failed to respond to authentication challenge"
);
git_error_set
(
GIT_ERROR_HTTP
,
"failed to respond to authentication challenge"
);
error
=
GIT_EAUTH
;
error
=
GIT_EAUTH
;
error
=
-
1
;
goto
done
;
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