summaryrefslogtreecommitdiff
path: root/fetch-pack.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2019-02-06 22:05:30 -0800
committerJunio C Hamano <gitster@pobox.com>2019-02-06 22:05:30 -0800
commit8f0f46539a8c557985241f3aec7a12bd5f2634c2 (patch)
tree0262313a52b3f5df514a38f945ca8263ea6e3acc /fetch-pack.c
parent0b5dc59c6b5bea37a425f84e64cd33cd0694a46d (diff)
parent380ebab209bc444e7a8ed0e914a4c6d7440b1d29 (diff)
downloadgit-8f0f46539a8c557985241f3aec7a12bd5f2634c2.tar.gz
Merge branch 'bc/fetch-pack-clear-alternate-shallow'
"git fetch" over protocol v2 that needs to make a second connection to backfill tags did not clear a variable that holds shallow repository information correctly, leading to an access of freed piece of memory. * bc/fetch-pack-clear-alternate-shallow: fetch-pack: clear alternate shallow in one more place fetch-pack: clear alternate shallow when complete
Diffstat (limited to 'fetch-pack.c')
-rw-r--r--fetch-pack.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/fetch-pack.c b/fetch-pack.c
index 08b3b356fa..812be15d7e 100644
--- a/fetch-pack.c
+++ b/fetch-pack.c
@@ -1290,6 +1290,8 @@ static void receive_shallow_info(struct fetch_pack_args *args,
setup_alternate_shallow(&shallow_lock, &alternate_shallow_file,
NULL);
args->deepen = 1;
+ } else {
+ alternate_shallow_file = NULL;
}
}
@@ -1514,6 +1516,7 @@ static void update_shallow(struct fetch_pack_args *args,
rollback_lock_file(&shallow_lock);
} else
commit_lock_file(&shallow_lock);
+ alternate_shallow_file = NULL;
return;
}
@@ -1537,6 +1540,7 @@ static void update_shallow(struct fetch_pack_args *args,
&alternate_shallow_file,
&extra);
commit_lock_file(&shallow_lock);
+ alternate_shallow_file = NULL;
}
oid_array_clear(&extra);
return;
@@ -1576,6 +1580,7 @@ static void update_shallow(struct fetch_pack_args *args,
commit_lock_file(&shallow_lock);
oid_array_clear(&extra);
oid_array_clear(&ref);
+ alternate_shallow_file = NULL;
return;
}