summaryrefslogtreecommitdiff
path: root/util/libreboot-utils/lib/mkhtemp.c
diff options
context:
space:
mode:
authorLeah Rowe <leah@libreboot.org>2026-04-21 06:39:50 +0100
committerLeah Rowe <leah@libreboot.org>2026-04-21 06:39:50 +0100
commite097eb5483b00631ef49353a22a73c2c48939d95 (patch)
treeb0446d36f711dd1b439f67571b38b13e17663f01 /util/libreboot-utils/lib/mkhtemp.c
parent7faf014a84e89f442f1ce35f5d0305074e77b85d (diff)
lbutils: don't use stack memory for path strings
Signed-off-by: Leah Rowe <leah@libreboot.org>
Diffstat (limited to 'util/libreboot-utils/lib/mkhtemp.c')
-rw-r--r--util/libreboot-utils/lib/mkhtemp.c6
1 files changed, 5 insertions, 1 deletions
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;
}