From 5f6f2c15b16f1b01e9d0969f4b10d23b867b266a Mon Sep 17 00:00:00 2001 From: Andrei Kortunov Date: Wed, 14 Apr 2021 08:07:43 +0400 Subject: [PATCH] An another attempt to suppress Coverity warning about mkstemp --- components/crashcatcher/crashcatcher.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/components/crashcatcher/crashcatcher.cpp b/components/crashcatcher/crashcatcher.cpp index b4b2a4a0c6..e0a5c964fa 100644 --- a/components/crashcatcher/crashcatcher.cpp +++ b/components/crashcatcher/crashcatcher.cpp @@ -150,6 +150,9 @@ static void gdb_info(pid_t pid) * So CoverityScan warning is valid only for ancient versions of stdlib. */ strcpy(respfile, "/tmp/gdb-respfile-XXXXXX"); +#ifdef __COVERITY__ + umask(0600); +#endif if((fd=mkstemp(respfile)) >= 0 && (f=fdopen(fd, "w")) != nullptr) { fprintf(f, "attach %d\n"