From: Junio C Hamano <gitster@pobox.com>
To: "Derrick Stolee via GitGitGadget" <gitgitgadget@gmail.com>
Cc: git@vger.kernel.org, Derrick Stolee <derrickstolee@github.com>,
Derrick Stolee <dstolee@microsoft.com>
Subject: Re: [PATCH] sparse-index: fix uninitialized jump
Date: Tue, 18 May 2021 06:45:57 +0900 [thread overview]
Message-ID: <xmqqo8d9590q.fsf@gitster.g> (raw)
In-Reply-To: <pull.953.git.1621254137590.gitgitgadget@gmail.com> (Derrick Stolee via GitGitGadget's message of "Mon, 17 May 2021 12:22:17 +0000")
"Derrick Stolee via GitGitGadget" <gitgitgadget@gmail.com> writes:
> From: Derrick Stolee <dstolee@microsoft.com>
>
> 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 <dstolee@microsoft.com>
> ---
Looks good.
> Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-953%2Fderrickstolee%2Fsparse-index%2Funinitialized-v1
> Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-953/derrickstolee/sparse-index/uninitialized-v1
> Pull-Request: https://github.com/gitgitgadget/git/pull/953
>
> sparse-index.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/sparse-index.c b/sparse-index.c
> index b0d5dc5f081b..affc4048f279 100644
> --- a/sparse-index.c
> +++ b/sparse-index.c
> @@ -34,7 +34,7 @@ static int convert_to_sparse_rec(struct index_state *istate,
> int i, can_convert = 1;
> int start_converted = num_converted;
> enum pattern_match_result match;
> - int dtype;
> + int dtype = DT_UNKNOWN;
> struct strbuf child_path = STRBUF_INIT;
> struct pattern_list *pl = istate->sparse_checkout_patterns;
>
>
> base-commit: bf949ade81106fbda068c1fdb2c6fd1cb1babe7e
prev parent reply other threads:[~2021-05-17 21:46 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-05-17 12:22 [PATCH] sparse-index: fix uninitialized jump Derrick Stolee via GitGitGadget
2021-05-17 21:45 ` Junio C Hamano [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=xmqqo8d9590q.fsf@gitster.g \
--to=gitster@pobox.com \
--cc=derrickstolee@github.com \
--cc=dstolee@microsoft.com \
--cc=git@vger.kernel.org \
--cc=gitgitgadget@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.