Andrew's git
/
gitweb.git
/ blobdiff
summary
|
log
|
commit
|
diff
|
tree
commit
grep
author
committer
pickaxe
?
re
builtin-for-each-ref.c::copy_name() - do not overstep the buffer.
[gitweb.git]
/
builtin-for-each-ref.c
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);
}