mirror of
https://github.com/isc-projects/bind9.git
synced 2026-06-09 19:19:59 -04:00
properly detect period as last character in filename
(cherry picked from commit c9dc59eb90)
This commit is contained in:
parent
4b0eaf7267
commit
b12970046a
2 changed files with 4 additions and 4 deletions
|
|
@ -113,10 +113,10 @@ is_safe(const char *input) {
|
|||
if (i == 0)
|
||||
return (false);
|
||||
/* '..', two dots together is not allowed. */
|
||||
else if (input[i-1] == '.')
|
||||
if (input[i-1] == '.')
|
||||
return (false);
|
||||
/* '.' is not allowed as last char */
|
||||
if (i == len)
|
||||
if (i == len - 1)
|
||||
return (false);
|
||||
/* only 1 dot in ok location, continue at next char */
|
||||
continue;
|
||||
|
|
|
|||
|
|
@ -106,10 +106,10 @@ is_safe(const char *input) {
|
|||
if (i == 0)
|
||||
return (false);
|
||||
/* '..', two dots together is not allowed. */
|
||||
else if (input[i-1] == '.')
|
||||
if (input[i-1] == '.')
|
||||
return (false);
|
||||
/* '.' is not allowed as last char */
|
||||
if (i == len)
|
||||
if (i == len - 1)
|
||||
return (false);
|
||||
/* only 1 dot in ok location, continue at next char */
|
||||
continue;
|
||||
|
|
|
|||
Loading…
Reference in a new issue