From 0425ab87ad21e5dbbd4a0d31e5559370ea872afd Mon Sep 17 00:00:00 2001 From: Peter Hoddie Date: Fri, 21 Jul 2023 12:55:30 -0700 Subject: [PATCH] don't overflow stack buffer --- xsnap/sources/xsnapPlatform.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/xsnap/sources/xsnapPlatform.c b/xsnap/sources/xsnapPlatform.c index eb221d4..79e777c 100644 --- a/xsnap/sources/xsnapPlatform.c +++ b/xsnap/sources/xsnapPlatform.c @@ -454,6 +454,8 @@ txID fxFindModule(txMachine* the, txSlot* realm, txID moduleID, txSlot* slot) else slash = path; *slash = 0; + if ((c_strlen(path) + c_strlen(name + dot)) >= sizeof(path)) + mxRangeError("path too long"); c_strcat(path, name + dot); return fxNewNameC(the, path); }