From 5f293f0453aa6b03e06cc56b0126024cec847e24 Mon Sep 17 00:00:00 2001 From: midipix Date: Mon, 30 Dec 2024 05:50:10 +0000 Subject: slbt_ar_merge_archives(), slbt_tmpfile(): guard against 32-bit time_t types. --- src/internal/slibtool_tmpfile_impl.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/internal/slibtool_tmpfile_impl.c') diff --git a/src/internal/slibtool_tmpfile_impl.c b/src/internal/slibtool_tmpfile_impl.c index 52c7317..3ed7d3a 100644 --- a/src/internal/slibtool_tmpfile_impl.c +++ b/src/internal/slibtool_tmpfile_impl.c @@ -61,6 +61,7 @@ slbt_hidden int slbt_tmpfile(void) { int fd; void * addr; + int64_t tint; char tmplate[128]; /* try with __fs_tmpfile() */ @@ -73,6 +74,7 @@ slbt_hidden int slbt_tmpfile(void) /* fallback to mk{o}stemp */ addr = tmplate; + tint = time(0); memset(tmplate,0,sizeof(tmplate)); snprintf(tmplate,sizeof(tmplate), "/tmp/" @@ -81,8 +83,7 @@ slbt_hidden int slbt_tmpfile(void) ".salt.%p" ".pid.%d" ".XXXXXXXXXXXX", - time(0), - addr, + tint,addr, getpid()); return slbt_mkostemp(tmplate); -- cgit v1.2.3