зеркало из https://github.com/microsoft/git.git
object-refs: avoid division by zero
Currently, we don't check refs_hash_size size and happily call lookup_object_refs() even if refs_hash_size is zero which leads to a division by zero in hash_obj(). Signed-off-by: Andre Noll <maan@systemlinux.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
This commit is contained in:
Родитель
bb9e15a83c
Коммит
86f660b1f1
|
@ -127,6 +127,9 @@ void mark_reachable(struct object *obj, unsigned int mask)
|
||||||
|
|
||||||
if (!track_object_refs)
|
if (!track_object_refs)
|
||||||
die("cannot do reachability with object refs turned off");
|
die("cannot do reachability with object refs turned off");
|
||||||
|
/* nothing to lookup */
|
||||||
|
if (!refs_hash_size)
|
||||||
|
return;
|
||||||
/* If we've been here already, don't bother */
|
/* If we've been here already, don't bother */
|
||||||
if (obj->flags & mask)
|
if (obj->flags & mask)
|
||||||
return;
|
return;
|
||||||
|
|
Загрузка…
Ссылка в новой задаче