mirror of
https://git.proxmox.com/git/libgit2
synced 2025-05-09 19:58:09 +00:00
Fix the reference character check for Unicode
We need to do an unsigned comparison, as otherwise UTF-8 characters might look like they have the sign bit set and the check will fail. Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
This commit is contained in:
parent
3a97bff3dc
commit
50a8fd0367
@ -1647,7 +1647,7 @@ void git_repository__refcache_free(git_refcache *refs)
|
||||
*****************************************/
|
||||
static int check_valid_ref_char(char ch)
|
||||
{
|
||||
if (ch <= ' ')
|
||||
if ((unsigned) ch <= ' ')
|
||||
return GIT_ERROR;
|
||||
|
||||
switch (ch) {
|
||||
@ -1752,4 +1752,4 @@ int git_reference__normalize_name(char *buffer_out, size_t out_size, const char
|
||||
int git_reference__normalize_name_oid(char *buffer_out, size_t out_size, const char *name)
|
||||
{
|
||||
return normalize_name(buffer_out, out_size, name, 1);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user