tree-wide: use stat_verify_regular() more

This commit is contained in:
Lennart Poettering
2026-04-13 13:20:43 +02:00
parent bda7e91337
commit 8e0756c0b5
2 changed files with 8 additions and 4 deletions
+4 -2
View File
@@ -16,6 +16,7 @@
#include "path-util.h"
#include "process-util.h"
#include "set.h"
#include "stat-util.h"
#include "string-table.h"
#include "string-util.h"
#include "strv.h"
@@ -115,8 +116,9 @@ static int add_locales_from_archive(Set *locales) {
if (fstat(fd, &st) < 0)
return -errno;
if (!S_ISREG(st.st_mode))
return -EBADMSG;
r = stat_verify_regular(&st);
if (r < 0)
return r;
if (st.st_size < (off_t) sizeof(struct locarhead))
return -EBADMSG;