summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorVicent Martí <vicent@github.com>2013-03-07 07:47:20 -0800
committerVicent Martí <vicent@github.com>2013-03-07 07:47:20 -0800
commit6a9ef012376e8a21dcfd0499ab16048eb6e954c3 (patch)
treee501f5be5296ce8d894e69867eb511a6be81fa27 /src
parent9952f24e6cc71ef5ecd13831f783e308aae97c36 (diff)
parentbb45c57f94d3c7c96e78234e2a81393c0ced45a0 (diff)
downloadlibgit2-6a9ef012376e8a21dcfd0499ab16048eb6e954c3.tar.gz
Merge pull request #1401 from carlosmn/leading-slash
refs: explicitly catch leading slashes
Diffstat (limited to 'src')
-rw-r--r--src/refs.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/refs.c b/src/refs.c
index 113cadad5..dd3dd64b1 100644
--- a/src/refs.c
+++ b/src/refs.c
@@ -1667,6 +1667,9 @@ int git_reference__normalize_name(
process_flags = flags;
current = (char *)name;
+ if (*current == '/')
+ goto cleanup;
+
if (normalize)
git_buf_clear(buf);