Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNguyễn Thái Ngọc Duy <pclouds@gmail.com>2016-06-12 13:53:50 +0300
committerJunio C Hamano <gitster@pobox.com>2016-06-14 00:38:16 +0300
commit6e414e30fd12460d7a7ba3ce67d20aa82a41a737 (patch)
tree1d89d2e5e373985a4b3cb6592d7ddc7f960cd1be /upload-pack.c
parent8bf3b75841ead5a796b62a54534b5a203adffae4 (diff)
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>
Diffstat (limited to 'upload-pack.c')
-rw-r--r--upload-pack.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/upload-pack.c b/upload-pack.c
index fa7ce092e7..8f4d7f46cc 100644
--- a/upload-pack.c
+++ b/upload-pack.c
@@ -645,9 +645,9 @@ static void receive_needs(void)
continue;
}
if (skip_prefix(line, "deepen ", &arg)) {
- char *end;
+ char *end = NULL;
depth = strtol(arg, &end, 0);
- if (end == arg || depth <= 0)
+ if (!end || *end || depth <= 0)
die("Invalid deepen: %s", line);
continue;
}