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
2ffa426e
Unverified
Commit
2ffa426e
authored
Jul 09, 2020
by
Edward Thomson
Committed by
GitHub
Jul 09, 2020
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #5567 from lhchavez/msan
Make the tests pass cleanly with MemorySanitizer
parents
60536163
3a197ea7
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
21 additions
and
13 deletions
+21
-13
deps/zlib/deflate.c
+1
-0
src/diff_file.c
+3
-1
src/indexer.c
+4
-1
src/object.c
+2
-1
src/odb.c
+4
-3
src/odb_loose.c
+3
-3
src/regexp.c
+2
-2
tests/checkout/tree.c
+1
-1
tests/status/worktree.c
+1
-1
No files found.
deps/zlib/deflate.c
View file @
2ffa426e
...
...
@@ -320,6 +320,7 @@ int ZEXPORT deflateInit2_(strm, level, method, windowBits, memLevel, strategy,
s
->
window
=
(
Bytef
*
)
ZALLOC
(
strm
,
s
->
w_size
,
2
*
sizeof
(
Byte
));
s
->
prev
=
(
Posf
*
)
ZALLOC
(
strm
,
s
->
w_size
,
sizeof
(
Pos
));
memset
(
s
->
prev
,
0
,
s
->
w_size
*
sizeof
(
Pos
));
s
->
head
=
(
Posf
*
)
ZALLOC
(
strm
,
s
->
hash_size
,
sizeof
(
Pos
));
s
->
high_water
=
0
;
/* nothing written to s->window yet */
...
...
src/diff_file.c
View file @
2ffa426e
...
...
@@ -160,8 +160,10 @@ int git_diff_file_content__init_from_src(
fc
->
flags
|=
GIT_DIFF_FLAG__FREE_BLOB
;
}
else
{
int
error
;
if
((
error
=
git_odb_hash
(
&
fc
->
file
->
id
,
src
->
buf
,
src
->
buflen
,
GIT_OBJECT_BLOB
))
<
0
)
return
error
;
fc
->
file
->
size
=
src
->
buflen
;
git_odb_hash
(
&
fc
->
file
->
id
,
src
->
buf
,
src
->
buflen
,
GIT_OBJECT_BLOB
);
fc
->
file
->
id_abbrev
=
GIT_OID_HEXSZ
;
fc
->
map
.
len
=
src
->
buflen
;
...
...
src/indexer.c
View file @
2ffa426e
...
...
@@ -427,7 +427,10 @@ static int store_object(git_indexer *idx)
pentry
=
git__calloc
(
1
,
sizeof
(
struct
git_pack_entry
));
GIT_ERROR_CHECK_ALLOC
(
pentry
);
git_hash_final
(
&
oid
,
&
idx
->
hash_ctx
);
if
(
git_hash_final
(
&
oid
,
&
idx
->
hash_ctx
))
{
git__free
(
pentry
);
goto
on_error
;
}
entry_size
=
idx
->
off
-
entry_start
;
if
(
entry_start
>
UINT31_MAX
)
{
entry
->
offset
=
UINT32_MAX
;
...
...
src/object.c
View file @
2ffa426e
...
...
@@ -86,7 +86,8 @@ int git_object__from_raw(
GIT_ERROR_CHECK_ALLOC
(
object
);
object
->
cached
.
flags
=
GIT_CACHE_STORE_PARSED
;
object
->
cached
.
type
=
type
;
git_odb_hash
(
&
object
->
cached
.
oid
,
data
,
size
,
type
);
if
((
error
=
git_odb_hash
(
&
object
->
cached
.
oid
,
data
,
size
,
type
))
<
0
)
return
error
;
/* Parse raw object data */
def
=
&
git_objects_table
[
type
];
...
...
src/odb.c
View file @
2ffa426e
...
...
@@ -1283,12 +1283,13 @@ int git_odb_write(
git_oid
*
oid
,
git_odb
*
db
,
const
void
*
data
,
size_t
len
,
git_object_t
type
)
{
size_t
i
;
int
error
=
GIT_ERROR
;
int
error
;
git_odb_stream
*
stream
;
assert
(
oid
&&
db
);
git_odb_hash
(
oid
,
data
,
len
,
type
);
if
((
error
=
git_odb_hash
(
oid
,
data
,
len
,
type
))
<
0
)
return
error
;
if
(
git_oid_is_zero
(
oid
))
return
error_null_oid
(
GIT_EINVALID
,
"cannot write object"
);
...
...
@@ -1296,7 +1297,7 @@ int git_odb_write(
if
(
git_odb__freshen
(
db
,
oid
))
return
0
;
for
(
i
=
0
;
i
<
db
->
backends
.
length
&&
error
<
0
;
++
i
)
{
for
(
i
=
0
,
error
=
GIT_ERROR
;
i
<
db
->
backends
.
length
&&
error
<
0
;
++
i
)
{
backend_internal
*
internal
=
git_vector_get
(
&
db
->
backends
,
i
);
git_odb_backend
*
b
=
internal
->
backend
;
...
...
src/odb_loose.c
View file @
2ffa426e
...
...
@@ -304,7 +304,7 @@ static int read_loose_standard(git_rawobj *out, git_buf *obj)
* (including the initial sequence in the head buffer).
*/
if
(
GIT_ADD_SIZET_OVERFLOW
(
&
alloc_size
,
hdr
.
size
,
1
)
||
(
body
=
git__
malloc
(
alloc_size
))
==
NULL
)
{
(
body
=
git__
calloc
(
1
,
alloc_size
))
==
NULL
)
{
error
=
-
1
;
goto
done
;
}
...
...
@@ -386,8 +386,8 @@ static int read_header_loose_standard(
git_rawobj
*
out
,
const
unsigned
char
*
data
,
size_t
len
)
{
git_zstream
zs
=
GIT_ZSTREAM_INIT
;
obj_hdr
hdr
;
unsigned
char
inflated
[
MAX_HEADER_LEN
];
obj_hdr
hdr
=
{
0
}
;
unsigned
char
inflated
[
MAX_HEADER_LEN
]
=
{
0
}
;
size_t
header_len
,
inflated_len
=
sizeof
(
inflated
);
int
error
;
...
...
src/regexp.c
View file @
2ffa426e
...
...
@@ -12,7 +12,7 @@
int
git_regexp_compile
(
git_regexp
*
r
,
const
char
*
pattern
,
int
flags
)
{
int
erroffset
,
cflags
=
0
;
const
char
*
error
;
const
char
*
error
=
NULL
;
if
(
flags
&
GIT_REGEXP_ICASE
)
cflags
|=
PCRE_CASELESS
;
...
...
@@ -41,7 +41,7 @@ int git_regexp_match(const git_regexp *r, const char *string)
int
git_regexp_search
(
const
git_regexp
*
r
,
const
char
*
string
,
size_t
nmatches
,
git_regmatch
*
matches
)
{
int
static_ovec
[
9
],
*
ovec
;
int
static_ovec
[
9
]
=
{
0
}
,
*
ovec
;
int
error
;
size_t
i
;
...
...
tests/checkout/tree.c
View file @
2ffa426e
...
...
@@ -917,7 +917,7 @@ void test_checkout_tree__extremely_long_file_name(void)
{
/* A utf-8 string with 83 characters, but 249 bytes. */
const
char
*
longname
=
"
\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97
"
;
char
path
[
1024
];
char
path
[
1024
]
=
{
0
}
;
g_opts
.
checkout_strategy
=
GIT_CHECKOUT_FORCE
;
cl_git_pass
(
git_revparse_single
(
&
g_object
,
g_repo
,
"long-file-name"
));
...
...
tests/status/worktree.c
View file @
2ffa426e
...
...
@@ -949,7 +949,7 @@ void test_status_worktree__sorting_by_case(void)
void
test_status_worktree__long_filenames
(
void
)
{
char
path
[
260
*
4
+
1
];
char
path
[
260
*
4
+
1
]
=
{
0
}
;
const
char
*
expected_paths
[]
=
{
path
};
const
unsigned
int
expected_statuses
[]
=
{
GIT_STATUS_WT_NEW
};
...
...
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