From da553d191f005e7a921dc1067b973e3d516b7d81 Mon Sep 17 00:00:00 2001 From: Vicki Pfau Date: Sun, 1 Sep 2024 01:36:07 -0700 Subject: [PATCH] Core: Extdata should not have a size < 0 --- src/core/serialize.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/core/serialize.c b/src/core/serialize.c index 203ed809a..4f7c07a4a 100644 --- a/src/core/serialize.c +++ b/src/core/serialize.c @@ -131,6 +131,9 @@ bool mStateExtdataDeserialize(struct mStateExtdata* extdata, struct VFile* vf) { if (vf->seek(vf, header.offset, SEEK_SET) < 0) { return false; } + if (header.size <= 0) { + continue; + } struct mStateExtdataItem item = { .data = malloc(header.size), .size = header.size,