Validate serialized nanoseconds range when reading content files

This commit is contained in:
Andrea Mazzoleni 2026-08-26 22:26:35 +02:00
parent e58eb16768
commit 95ac8d7b51

View file

@ -2370,7 +2370,7 @@ static void state_read_content(struct snapraid_state* state, const char* path, S
}
ret = sgetb32(f, &v_mtime_nsec);
if (ret < 0) {
if (ret < 0 || v_mtime_nsec > 1000000000) {
/* LCOV_EXCL_START */
decoding_error(path, f);
os_abort();
@ -2808,7 +2808,7 @@ static void state_read_content(struct snapraid_state* state, const char* path, S
}
ret = sgetb32(f, &v_mtime_nsec);
if (ret < 0) {
if (ret < 0 || v_mtime_nsec > 1000000000) {
/* LCOV_EXCL_START */
decoding_error(path, f);
os_abort();