summaryrefslogtreecommitdiff
path: root/pack-bitmap.c
diff options
context:
space:
mode:
authorJeff King <peff@peff.net>2021-04-28 15:42:30 (GMT)
committerJunio C Hamano <gitster@pobox.com>2021-04-29 01:03:46 (GMT)
commit1e951c647365be2e93bceddf7bd13173ed2cb1ce (patch)
tree51b69bcd12342bd618e41bc73afab7b06c1cf4d5 /pack-bitmap.c
parent48bf2fa8bad054d66bd79c6ba903c89c704201f7 (diff)
downloadgit-1e951c647365be2e93bceddf7bd13173ed2cb1ce.zip
git-1e951c647365be2e93bceddf7bd13173ed2cb1ce.tar.gz
git-1e951c647365be2e93bceddf7bd13173ed2cb1ce.tar.bz2
pack-bitmap: clean up include_check after use
When a bitmap walk has to traverse (to fill in non-bitmapped objects), we use rev_info's include_check mechanism to let us stop the traversal early. But after setting the function and its data parameter, we never clean it up. This means that if the rev_info is used for a subsequent traversal without bitmaps, it will unexpectedly call into our include_check function (worse, it will do so pointing to a now-defunct stack variable in include_check_data, likely resulting in a segfault). There's no code which does this now, but it's an accident waiting to happen. Let's clean up after ourselves in the bitmap code. Reported-by: David Emett <dave@sp4m.net> Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'pack-bitmap.c')
-rw-r--r--pack-bitmap.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/pack-bitmap.c b/pack-bitmap.c
index 1ebe0c8..84a9195 100644
--- a/pack-bitmap.c
+++ b/pack-bitmap.c
@@ -630,6 +630,9 @@ static struct bitmap *find_objects(struct bitmap_index *bitmap_git,
traverse_commit_list_filtered(filter, revs,
show_commit, show_object,
&show_data, NULL);
+
+ revs->include_check = NULL;
+ revs->include_check_data = NULL;
}
return base;