[Freeciv-Dev] Re: (PR#13463) New function to eval safety of filenames
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
<URL: http://bugs.freeciv.org/Ticket/Display.html?id=13463 >
Benoit Hudson wrote:
> <URL: http://bugs.freeciv.org/Ticket/Display.html?id=13463 >
>
>>+ if (!((name[i] <= 'z' && name[i] >= 'a')
>>+ || (name[i] <= 'Z' && name[i] >= 'A')
>>+ || (name[i] <= '9' && name[i] >= '0')
>>+ || name[i] == '-'
>>+ || name[i] == '_')) {
>>+ return FALSE;
>
> This assume ascii; while probably safe, we may want to use the
> functions in ctype.h like isalnum.
All of our code assumes the character set is a superset of ascii.
Fortunately this is true for all 8-bit charsets that I know of.
-jason
|
|