Skip to content

Commit

Permalink
coverity: #1425792
Browse files Browse the repository at this point in the history
Insecure temporary file

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
  • Loading branch information
Christian Brauner committed Jun 15, 2018
1 parent 71261a5 commit dd5c5a5
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/tests/parse_config_file.c
Expand Up @@ -31,6 +31,7 @@
#include "confile_utils.h"
#include "lxc/state.h"
#include "lxctest.h"
#include "utils.h"

static int set_get_compare_clear_save_load(struct lxc_container *c,
const char *key, const char *value,
Expand Down Expand Up @@ -302,7 +303,7 @@ int main(int argc, char *argv[])
char tmpf[] = "lxc-parse-config-file-XXXXXX";
char retval[4096] = {0};

fd = mkstemp(tmpf);
fd = lxc_make_tmpfile(tmpf, false);
if (fd < 0) {
lxc_error("%s\n", "Could not create temporary file");
exit(fret);
Expand Down

0 comments on commit dd5c5a5

Please sign in to comment.