From 880a86df301a93e60bf6e07eb08e5c418a71f09d Mon Sep 17 00:00:00 2001 From: Vicki Pfau Date: Mon, 3 Sep 2018 11:22:20 -0700 Subject: [PATCH] Core: Fix stack bound error --- src/core/serialize.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/core/serialize.c b/src/core/serialize.c index fe1015bb8..bdbab209e 100644 --- a/src/core/serialize.c +++ b/src/core/serialize.c @@ -327,9 +327,10 @@ bool mCoreSaveStateNamed(struct mCore* core, struct VFile* vf, int flags) { struct mStateExtdataItem item = { .size = sizeof(creationUsec), - .data = &creationUsec, - .clean = NULL + .data = malloc(sizeof(creationUsec)), + .clean = free }; + *(uint64_t*) item.data = creationUsec; mStateExtdataPut(&extdata, EXTDATA_META_TIME, &item); }