|
|
|
|
@ -372,12 +372,17 @@ GncXmlBackend::write_to_file (bool make_backup)
|
|
|
|
|
strcpy (tmp_name, m_fullpath.c_str());
|
|
|
|
|
strcat (tmp_name, ".tmp-XXXXXX");
|
|
|
|
|
|
|
|
|
|
/* Clang static analyzer flags this as a security risk, which is
|
|
|
|
|
/* Clang static analyzer and GNU ld flag mktemp as a security risk, which is
|
|
|
|
|
* theoretically true, but we can't use mkstemp because we need to
|
|
|
|
|
* open the file ourselves because of compression. None of the alternatives
|
|
|
|
|
* is any more secure.
|
|
|
|
|
*
|
|
|
|
|
* Xcode marks mktemp as deprecated
|
|
|
|
|
*/
|
|
|
|
|
#pragma GCC diagnostic push
|
|
|
|
|
#pragma GCC diagnostic warning "-Wdeprecated-declarations"
|
|
|
|
|
if (!mktemp (tmp_name))
|
|
|
|
|
#pragma GCC diagnostic pop
|
|
|
|
|
{
|
|
|
|
|
g_free (tmp_name);
|
|
|
|
|
set_error(ERR_BACKEND_MISC);
|
|
|
|
|
|