1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-01-19 21:53:51 +00:00

Try to disable CoverityScan warning in code with explanation

This commit is contained in:
Andrei Kortunov 2020-10-28 14:21:45 +04:00
parent fb53b397ff
commit 00503d86e1

View file

@ -143,8 +143,14 @@ static void gdb_info(pid_t pid)
FILE *f;
int fd;
/* Create a temp file to put gdb commands into */
/*
* Create a temp file to put gdb commands into.
* Note: POSIX.1-2008 declares that the file should be already created with mode 0600 by default.
* Modern systems implement it and and suggest to do not touch masks in multithreaded applications.
* So CoverityScan warning is valid only for ancient versions of stdlib.
*/
strcpy(respfile, "/tmp/gdb-respfile-XXXXXX");
// coverity[secure_temp]
if((fd=mkstemp(respfile)) >= 0 && (f=fdopen(fd, "w")) != nullptr)
{
fprintf(f, "attach %d\n"