Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/libgit2/refs.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
1 change: 1 addition & 0 deletions tests/libgit2/refs/isvalidname.c
Original file line number Diff line number Diff line change
Expand Up @@ -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"));
}

Expand Down