Commit c80efb5f6db4bff67089f4a67906ad831a9a09d9

Edward Thomson 2016-06-20T11:16:49

Merge pull request #3818 from meatcoder/fix_odb_read_error Fix truncation of SHA in error message for git_odb_read

1
2
3
4
5
6
7
8
9
10
11
12
13
diff --git a/src/odb.c b/src/odb.c
index 890e6e2..87c1bb6 100644
--- a/src/odb.c
+++ b/src/odb.c
@@ -1362,7 +1362,7 @@ int git_odb__error_notfound(
 {
 	if (oid != NULL) {
 		char oid_str[GIT_OID_HEXSZ + 1];
-		git_oid_tostr(oid_str, oid_len, oid);
+		git_oid_tostr(oid_str, oid_len+1, oid);
 		giterr_set(GITERR_ODB, "Object not found - %s (%.*s)",
 			message, oid_len, oid_str);
 	} else