mirror of
https://gitlab.isc.org/isc-projects/bind9
synced 2025-09-01 06:55:30 +00:00
properly detect period as last character in filename
This commit is contained in:
@@ -113,10 +113,10 @@ is_safe(const char *input) {
|
|||||||
if (i == 0)
|
if (i == 0)
|
||||||
return (false);
|
return (false);
|
||||||
/* '..', two dots together is not allowed. */
|
/* '..', two dots together is not allowed. */
|
||||||
else if (input[i-1] == '.')
|
if (input[i-1] == '.')
|
||||||
return (false);
|
return (false);
|
||||||
/* '.' is not allowed as last char */
|
/* '.' is not allowed as last char */
|
||||||
if (i == len)
|
if (i == len - 1)
|
||||||
return (false);
|
return (false);
|
||||||
/* only 1 dot in ok location, continue at next char */
|
/* only 1 dot in ok location, continue at next char */
|
||||||
continue;
|
continue;
|
||||||
|
@@ -106,10 +106,10 @@ is_safe(const char *input) {
|
|||||||
if (i == 0)
|
if (i == 0)
|
||||||
return (false);
|
return (false);
|
||||||
/* '..', two dots together is not allowed. */
|
/* '..', two dots together is not allowed. */
|
||||||
else if (input[i-1] == '.')
|
if (input[i-1] == '.')
|
||||||
return (false);
|
return (false);
|
||||||
/* '.' is not allowed as last char */
|
/* '.' is not allowed as last char */
|
||||||
if (i == len)
|
if (i == len - 1)
|
||||||
return (false);
|
return (false);
|
||||||
/* only 1 dot in ok location, continue at next char */
|
/* only 1 dot in ok location, continue at next char */
|
||||||
continue;
|
continue;
|
||||||
|
Reference in New Issue
Block a user