void-packages/srcpkgs/virtuoso/patches/use-mkstemp.patch
2020-01-27 16:18:10 +01:00

18 lines
583 B
Diff

Source: @pullmoll
Upstream: no
Reason: Avoid mktemp(3) because "Never use this function; see BUGS."
--- libsrc/Dk/Dksesstr.c 2018-08-16 01:06:21.000000000 +0200
+++ libsrc/Dk/Dksesstr.c 2020-01-27 15:22:00.953876251 +0100
@@ -298,8 +298,10 @@
if (!ses2->ses_file->ses_max_blocks_in_mem)
{
char fname[PATH_MAX + 1];
+ int fd;
snprintf (fname, sizeof (fname), "%s/sesXXXXXX", ses_tmp_dir);
- mktemp (fname);
+ fd = mkstemp (fname);
+ close (fd);
#if defined (WIN32)
# define OPEN_FLAGS O_CREAT | O_RDWR | O_BINARY | O_EXCL | O_TEMPORARY