Skip to content

Commit 6e414e3

Browse files
pcloudsgitster
authored andcommitted
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>
1 parent 8bf3b75 commit 6e414e3

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

upload-pack.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -645,9 +645,9 @@ static void receive_needs(void)
645645
continue;
646646
}
647647
if (skip_prefix(line, "deepen ", &arg)) {
648-
char *end;
648+
char *end = NULL;
649649
depth = strtol(arg, &end, 0);
650-
if (end == arg || depth <= 0)
650+
if (!end || *end || depth <= 0)
651651
die("Invalid deepen: %s", line);
652652
continue;
653653
}

0 commit comments

Comments
 (0)