Andrew's git
/
gitweb.git
/ diff
summary
|
log
|
commit
| diff |
tree
commit
grep
author
committer
pickaxe
?
re
resolve_ref(): do not follow incorrectly-formatted symbolic refs
author
Michael Haggerty
<mhagger@alum.mit.edu>
Thu, 15 Sep 2011 21:10:36 +0000
(23:10 +0200)
committer
Junio C Hamano
<gitster@pobox.com>
Wed, 5 Oct 2011 20:45:31 +0000
(13:45 -0700)
Emit a warning and fail if a symbolic reference refers to an
incorrectly-formatted refname.
Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
refs.c
patch
|
blob
|
history
raw
|
patch
| inline |
side by side
(parent:
c224ca7
)
diff --git
a/refs.c
b/refs.c
index 473f7f6bc6b01c69d12dc3997232aa0df2a7ce16..b0555018995e5f029f3dd1d014e1ac9ef74c3672 100644
(file)
--- a/
refs.c
+++ b/
refs.c
@@
-581,6
+581,11
@@
const char *resolve_ref(const char *ref, unsigned char *sha1, int reading, int *
buf = buffer + 4;
while (isspace(*buf))
buf++;
+ if (check_refname_format(buf, REFNAME_ALLOW_ONELEVEL)) {
+ warning("symbolic reference in %s is formatted incorrectly",
+ path);
+ return NULL;
+ }
ref = strcpy(ref_buffer, buf);
if (flag)
*flag |= REF_ISSYMREF;