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);
return 0;
/* basic@{time or number} format to query ref-log */
- reflog_len = 0;
+ reflog_len = at = 0;
if (str[len-1] == '}') {
for (at = 1; at < len - 1; at++) {
if (str[at] == '@' && str[at+1] == '{') {