Bail out on path truncation
This commit is contained in:
parent
b5c3bcda7d
commit
941ffd2aed
@ -36,8 +36,10 @@ delete_content(const char *dir, dev_t curdevice)
|
|||||||
continue;
|
continue;
|
||||||
|
|
||||||
/* build path and dive deeper */
|
/* build path and dive deeper */
|
||||||
strlcat(path, dir, sizeof(path));
|
if (strlcat(path, dir, sizeof(path)) >= sizeof(path))
|
||||||
strlcat(path, dent->d_name, sizeof(path));
|
eprintf("path too long\n");
|
||||||
|
if (strlcat(path, dent->d_name, sizeof(path)) >= sizeof(path))
|
||||||
|
eprintf("path too long\n");
|
||||||
|
|
||||||
delete_content(path, curdevice);
|
delete_content(path, curdevice);
|
||||||
path[0] = 0;
|
path[0] = 0;
|
||||||
|
Loading…
Reference in New Issue
Block a user