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
This commit is contained in:
@ -1290,6 +1290,8 @@ static void receive_shallow_info(struct fetch_pack_args *args,
|
|||||||
setup_alternate_shallow(&shallow_lock, &alternate_shallow_file,
|
setup_alternate_shallow(&shallow_lock, &alternate_shallow_file,
|
||||||
NULL);
|
NULL);
|
||||||
args->deepen = 1;
|
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);
|
rollback_lock_file(&shallow_lock);
|
||||||
} else
|
} else
|
||||||
commit_lock_file(&shallow_lock);
|
commit_lock_file(&shallow_lock);
|
||||||
|
alternate_shallow_file = NULL;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1537,6 +1540,7 @@ static void update_shallow(struct fetch_pack_args *args,
|
|||||||
&alternate_shallow_file,
|
&alternate_shallow_file,
|
||||||
&extra);
|
&extra);
|
||||||
commit_lock_file(&shallow_lock);
|
commit_lock_file(&shallow_lock);
|
||||||
|
alternate_shallow_file = NULL;
|
||||||
}
|
}
|
||||||
oid_array_clear(&extra);
|
oid_array_clear(&extra);
|
||||||
return;
|
return;
|
||||||
@ -1576,6 +1580,7 @@ static void update_shallow(struct fetch_pack_args *args,
|
|||||||
commit_lock_file(&shallow_lock);
|
commit_lock_file(&shallow_lock);
|
||||||
oid_array_clear(&extra);
|
oid_array_clear(&extra);
|
||||||
oid_array_clear(&ref);
|
oid_array_clear(&ref);
|
||||||
|
alternate_shallow_file = NULL;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user