]> git.ipfire.org Git - thirdparty/git.git/blobdiff - sha1_name.c
Built-in cherry
[thirdparty/git.git] / sha1_name.c
index 9b226e3579b68fe8b59c7105bd926e3a0a70b0ad..6ffee22081aee3fc7b27b9ccc93c4c721652ec4b 100644 (file)
@@ -157,7 +157,7 @@ static int get_short_sha1(const char *name, int len, unsigned char *sha1,
        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);