diff --git a/sha1_name.c b/sha1_name.c
index 5cf5578af1e346788bd6276a26d996cb83a2208d..6d7cd78381414aa2fef31d31d46fbb24b0aaab1d 100644 (file)
--- a/sha1_name.c
+++ b/sha1_name.c
char canonical[40];
unsigned char res[20];
- if (len < MINIMUM_ABBREV)
+ if (len < MINIMUM_ABBREV || len > 40)
return -1;
hashclr(res);
memset(canonical, 'x', 40);