mirror of
https://github.com/amadvance/snapraid.git
synced 2026-10-26 10:51:54 -04:00
Reject root directory pattern '/' in file filter allocation
This commit is contained in:
parent
7b2007e503
commit
3bd3eff451
1 changed files with 6 additions and 0 deletions
|
|
@ -45,6 +45,12 @@ struct snapraid_filter* filter_alloc_file(int direction, const char* root, const
|
|||
pathimport(filter->root, sizeof(filter->root), root);
|
||||
filter->direction = direction;
|
||||
|
||||
/* reject the root directory as an invalid pattern */
|
||||
if (pathcmp(filter->pattern, "/") == 0) {
|
||||
free(filter);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* find first and last slash */
|
||||
first = 0;
|
||||
last = 0;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue