mirror of
https://github.com/linux-msm/qdl.git
synced 2026-10-07 06:29:17 -07:00
rmtree() concatenates the directory path and entry name into a PATH_MAX buffer without checking for truncation, which -Wformat- truncation flags on the Windows build where PATH_MAX is 260. A truncated path would also make the cleanup delete the wrong file in principle. Check the snprintf() result and skip entries that do not fit; using the return value also satisfies the warning. A skipped entry means the parent rmdir() fails with ENOTEMPTY and the workdir lingers, so report the skip on stderr instead of hiding it - the message names the entry, making a leftover workdir traceable to its cause. Signed-off-by: Igor Opaniuk <igor.opaniuk@oss.qualcomm.com>