projects
/
git.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
ca03283
)
builtin-for-each-ref.c::copy_name() - do not overstep the buffer.
author
Junio C Hamano
<gitster@pobox.com>
Wed, 19 Sep 2007 08:52:59 +0000
(
01:52
-0700)
committer
Junio C Hamano
<gitster@pobox.com>
Wed, 19 Sep 2007 08:54:24 +0000
(
01:54
-0700)
This was introduced during xmemdupz() conversion.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin-for-each-ref.c
patch
|
blob
|
history
diff --git
a/builtin-for-each-ref.c
b/builtin-for-each-ref.c
index 725c1df0fca375e9585ac09757f68204406598ec..e868a4b6d7f2fe59437ccab12ea7a9b16f4a2163 100644
(file)
--- a/
builtin-for-each-ref.c
+++ b/
builtin-for-each-ref.c
@@
-309,7
+309,7
@@
static const char *copy_line(const char *buf)
static const char *copy_name(const char *buf)
{
const char *cp;
- for (cp = buf; *cp != '\n'; cp++) {
+ for (cp = buf; *cp
&& *cp
!= '\n'; cp++) {
if (!strncmp(cp, " <", 2))
return xmemdupz(buf, cp - buf);
}