From e097eb5483b00631ef49353a22a73c2c48939d95 Mon Sep 17 00:00:00 2001 From: Leah Rowe Date: Tue, 21 Apr 2026 06:39:50 +0100 Subject: lbutils: don't use stack memory for path strings Signed-off-by: Leah Rowe --- util/libreboot-utils/lib/mkhtemp.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'util/libreboot-utils/lib/mkhtemp.c') diff --git a/util/libreboot-utils/lib/mkhtemp.c b/util/libreboot-utils/lib/mkhtemp.c index da44a7e2..d394ae73 100644 --- a/util/libreboot-utils/lib/mkhtemp.c +++ b/util/libreboot-utils/lib/mkhtemp.c @@ -195,7 +195,11 @@ env_tmpdir(int bypass_all_sticky_checks, char **tmpdir, bypass_all_sticky_checks)) goto err; - rval = t; + rval = NULL; + if (t != NULL) { + if (sdup(t, PATH_MAX, &rval) == NULL) + goto err; + } goto out; } -- cgit v1.2.1