diff --git a/contrib/dlz/drivers/dlz_filesystem_driver.c b/contrib/dlz/drivers/dlz_filesystem_driver.c index a8af12d983..879cb67098 100644 --- a/contrib/dlz/drivers/dlz_filesystem_driver.c +++ b/contrib/dlz/drivers/dlz_filesystem_driver.c @@ -112,10 +112,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; diff --git a/contrib/dlz/modules/filesystem/dlz_filesystem_dynamic.c b/contrib/dlz/modules/filesystem/dlz_filesystem_dynamic.c index d164f530c8..a147a21c4f 100644 --- a/contrib/dlz/modules/filesystem/dlz_filesystem_dynamic.c +++ b/contrib/dlz/modules/filesystem/dlz_filesystem_dynamic.c @@ -105,10 +105,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;