upload-pack: tighten number parsing at "deepen" lines
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
parent
8bf3b75841
commit
6e414e30fd
@ -645,9 +645,9 @@ static void receive_needs(void)
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (skip_prefix(line, "deepen ", &arg)) {
|
if (skip_prefix(line, "deepen ", &arg)) {
|
||||||
char *end;
|
char *end = NULL;
|
||||||
depth = strtol(arg, &end, 0);
|
depth = strtol(arg, &end, 0);
|
||||||
if (end == arg || depth <= 0)
|
if (!end || *end || depth <= 0)
|
||||||
die("Invalid deepen: %s", line);
|
die("Invalid deepen: %s", line);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user