mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 18:18:18 +00:00
Remove possible overflow in str_comp_filenames (fixes #6204)
This commit is contained in:
parent
f230ad0bdc
commit
ed58668931
|
@ -2834,7 +2834,6 @@ int str_comp_filenames(const char *a, const char *b)
|
||||||
result = 0;
|
result = 0;
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
if(!result)
|
|
||||||
result = *a - *b;
|
result = *a - *b;
|
||||||
++a;
|
++a;
|
||||||
++b;
|
++b;
|
||||||
|
@ -2844,7 +2843,7 @@ int str_comp_filenames(const char *a, const char *b)
|
||||||
return 1;
|
return 1;
|
||||||
else if(*b >= '0' && *b <= '9')
|
else if(*b >= '0' && *b <= '9')
|
||||||
return -1;
|
return -1;
|
||||||
else if(result)
|
else
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue