From 3e631d49830e1ebb8393bcc15794a34b7cb18f61 Mon Sep 17 00:00:00 2001 From: qiuweibin <354238065@qq.com> Date: Mon, 17 Mar 2025 00:50:16 +0000 Subject: [PATCH 1/2] Fix the null reference vulnerability. --- tests/libgit2/checkout/checkout_helpers.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/libgit2/checkout/checkout_helpers.c b/tests/libgit2/checkout/checkout_helpers.c index 1e9c21bdc5c..41dd5af1d1f 100644 --- a/tests/libgit2/checkout/checkout_helpers.c +++ b/tests/libgit2/checkout/checkout_helpers.c @@ -90,7 +90,7 @@ int checkout_count_callback( if (ct->debug) { if (workdir) fprintf(stderr, "M %s\n", workdir->path); - else + else if(baseline) fprintf(stderr, "D %s\n", baseline->path); } } From ee002304e3707bb06dd5b3c4e9b70b6d16a2b3d2 Mon Sep 17 00:00:00 2001 From: Edward Thomson Date: Thu, 5 Jun 2025 14:18:41 +0100 Subject: [PATCH 2/2] Update tests/libgit2/checkout/checkout_helpers.c --- tests/libgit2/checkout/checkout_helpers.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/libgit2/checkout/checkout_helpers.c b/tests/libgit2/checkout/checkout_helpers.c index 41dd5af1d1f..672881f441c 100644 --- a/tests/libgit2/checkout/checkout_helpers.c +++ b/tests/libgit2/checkout/checkout_helpers.c @@ -90,8 +90,10 @@ int checkout_count_callback( if (ct->debug) { if (workdir) fprintf(stderr, "M %s\n", workdir->path); - else if(baseline) + else if (baseline) fprintf(stderr, "D %s\n", baseline->path); + else + fprintf(stderr, "invalid notification - no workdir or baseline path\n"); } }