Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
openSUSE:Leap:42.1:Update
libgit2.6334
libgit2-validate-name-length.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File libgit2-validate-name-length.patch of Package libgit2.6334
diff --git a/src/tree.c b/src/tree.c index bfdcb82..10fdd4a 100644 --- a/src/tree.c +++ b/src/tree.c @@ -388,6 +388,7 @@ int git_tree__parse(void *_tree, git_odb_object *odb_obj) while (buffer < buffer_end) { git_tree_entry *entry; + const char *nul; int attr; if (git__strtol32(&attr, buffer, &buffer, 8) < 0 || !buffer) @@ -396,9 +397,15 @@ int git_tree__parse(void *_tree, git_odb_object *odb_obj) if (*buffer++ != ' ') return tree_error("Failed to parse tree. Object is corrupted", NULL); - if (memchr(buffer, 0, buffer_end - buffer) == NULL) + if ((nul = memchr(buffer, 0, buffer_end - buffer)) == NULL) return tree_error("Failed to parse tree. Object is corrupted", NULL); + if (nul - buffer == 0) + return tree_error("Failed to parse tree. Can't parse filename", NULL); + + if ((buffer_end - (nul + 1)) < GIT_OID_RAWSZ) + return tree_error("Failed to parse tree. Can't parse OID", NULL); + /** Allocate the entry and store it in the entries vector */ { entry = alloc_entry(buffer);
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor