summaryrefslogtreecommitdiff
path: root/src/tree-cache.c
diff options
context:
space:
mode:
authorPatrick Steinhardt <ps@pks.im>2018-10-26 14:54:25 +0200
committerGitHub <noreply@github.com>2018-10-26 14:54:25 +0200
commit32dc763c116999240440b5054798208d97b4c562 (patch)
tree8348a99862938d5d4ced1b8540c7674522489c1b /src/tree-cache.c
parent2bd9b6b67706c8cb84d367f699cc9c48c2719dff (diff)
parent3b6e006e38ab0c41968f4135104162861fa3f984 (diff)
downloadlibgit2-maint/v0.26.tar.gz
Merge pull request #4865 from pks-t/pks/v0.26.8v0.26.8maint/v0.26
Release v0.26.8
Diffstat (limited to 'src/tree-cache.c')
-rw-r--r--src/tree-cache.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/tree-cache.c b/src/tree-cache.c
index 548054136..17f235977 100644
--- a/src/tree-cache.c
+++ b/src/tree-cache.c
@@ -90,7 +90,7 @@ static int read_tree_internal(git_tree_cache **out,
return -1;
/* Blank-terminated ASCII decimal number of entries in this tree */
- if (git__strtol32(&count, buffer, &buffer, 10) < 0)
+ if (git__strntol32(&count, buffer, buffer_end - buffer, &buffer, 10) < 0)
goto corrupted;
tree->entry_count = count;
@@ -99,7 +99,7 @@ static int read_tree_internal(git_tree_cache **out,
goto corrupted;
/* Number of children of the tree, newline-terminated */
- if (git__strtol32(&count, buffer, &buffer, 10) < 0 || count < 0)
+ if (git__strntol32(&count, buffer, buffer_end - buffer, &buffer, 10) < 0 || count < 0)
goto corrupted;
tree->children_count = count;