Skip to content

Commit 4279cb1

Browse files
derrickstoleegitster
authored andcommitted
sparse-index: fix uninitialized jump
While testing the sparse-index, I verified a test with --valgrind and it complained about an uninitialized value being used in a jump in the path_matches_pattern_list() method. The line was this one: if (*dtype == DT_UNKNOWN) In the call stack, the culprit was the initialization of the dtype variable in convert_to_sparse_rec(). Signed-off-by: Derrick Stolee <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 4589bca commit 4279cb1

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

sparse-index.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ static int convert_to_sparse_rec(struct index_state *istate,
3434
int i, can_convert = 1;
3535
int start_converted = num_converted;
3636
enum pattern_match_result match;
37-
int dtype;
37+
int dtype = DT_UNKNOWN;
3838
struct strbuf child_path = STRBUF_INIT;
3939
struct pattern_list *pl = istate->sparse_checkout_patterns;
4040

0 commit comments

Comments
 (0)