diff options
author | Vicent Marti <tanoku@gmail.com> | 2010-10-08 13:52:17 +0300 |
---|---|---|
committer | Vicent Marti <tanoku@gmail.com> | 2010-10-08 13:52:17 +0300 |
commit | e4def81aab5df3ce1bd8622f3c89224d5910a97b (patch) | |
tree | 70f358a8d5eea6ed395b58f92c088f2855597d9f /src/git/tree.h | |
parent | 0ba7a0318652e5e89101e9ee72cb1356c21cef56 (diff) | |
download | libgit2-e4def81aab5df3ce1bd8622f3c89224d5910a97b.tar.gz |
Fix issue 3 (memory corruption resize_tree_array)
The tree array wasn't being initialized when instantiating a tree object
in memory instead of loading it from disk.
New unit tests added to check for the problem.
Signed-off-by: Vicent Marti <tanoku@gmail.com>
Diffstat (limited to 'src/git/tree.h')
-rw-r--r-- | src/git/tree.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/git/tree.h b/src/git/tree.h index bec49f245..9e2d0776a 100644 --- a/src/git/tree.h +++ b/src/git/tree.h @@ -113,8 +113,9 @@ GIT_EXTERN(git_object *) git_tree_entry_2object(git_tree_entry *entry); * @iparam id OID for the tree entry * @param filename Filename for the tree entry * @param attributes UNIX file attributes for the entry + * @return 0 on success; otherwise error code */ -GIT_EXTERN(void) git_tree_add_entry(git_tree *tree, const git_oid *id, const char *filename, int attributes); +GIT_EXTERN(int) git_tree_add_entry(git_tree *tree, const git_oid *id, const char *filename, int attributes); /** * Remove an entry by its index. |