Andrew's git
/
gitweb.git
/ diff
summary
|
log
|
commit
| diff |
tree
commit
grep
author
committer
pickaxe
?
re
Merge branch 'maint-1.6.0' into maint
author
Junio C Hamano
<gitster@pobox.com>
Tue, 27 Jan 2009 23:23:46 +0000
(15:23 -0800)
committer
Junio C Hamano
<gitster@pobox.com>
Tue, 27 Jan 2009 23:23:46 +0000
(15:23 -0800)
* maint-1.6.0:
test-path-utils: Fix off by one, found by valgrind
get_sha1_basic(): fix invalid memory access, found by valgrind
1
2
sha1_name.c
patch
|
diff1
|
diff2
|
blob
|
history
raw
|
compact
(merge:
5c41531
b8469ad
)
diff --combined
sha1_name.c
index 159c2ab84fa2cdde0e540024a1ca22e0bbb43af8,c4fdaded01192f4ddb3c8956dd5d1f7b83606817..722fc35a6d98e1c260c6e14738ad3b2d41d924aa
---
1
/
sha1_name.c
---
2
/
sha1_name.c
+++ b/
sha1_name.c
@@@
-309,7
-309,7
+309,7
@@@
static int get_sha1_basic(const char *s
/* basic@{time or number} format to query ref-log */
reflog_len = at = 0;
- if (str[len-1] == '}') {
+ if (
len &&
str[len-1] == '}') {
for (at = 0; at < len - 1; at++) {
if (str[at] == '@' && str[at+1] == '{') {
reflog_len = (len-1) - (at+2);
@@@
-351,10
-351,7
+351,10
@@@
else
nth = -1;
}
- if (0 <= nth)
+ if (100000000 <= nth) {
+ at_time = nth;
+ nth = -1;
+ } else if (0 <= nth)
at_time = 0;
else {
char *tmp = xstrndup(str + at + 2, reflog_len);