mirror of
https://github.com/libgit2/libgit2.git
synced 2026-01-25 02:56:17 +00:00
Merge pull request #7120 from xokdvium/refspec-del
refspec: Detect DEL character in is_valid_name
This commit is contained in:
@@ -819,7 +819,7 @@ int git_reference_list(
|
||||
|
||||
static int is_valid_ref_char(char ch)
|
||||
{
|
||||
if ((unsigned) ch <= ' ')
|
||||
if ((unsigned) ch <= ' ' || ch == '\177') /* ASCII control characters */
|
||||
return 0;
|
||||
|
||||
switch (ch) {
|
||||
|
||||
@@ -21,6 +21,7 @@ void test_refs_isvalidname__can_detect_invalid_formats(void)
|
||||
cl_assert_equal_i(false, is_valid_name("/"));
|
||||
cl_assert_equal_i(false, is_valid_name("//"));
|
||||
cl_assert_equal_i(false, is_valid_name(""));
|
||||
cl_assert_equal_i(false, is_valid_name("refs/heads/\177"));
|
||||
cl_assert_equal_i(false, is_valid_name("refs/heads/sub.lock/webmatrix"));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user