Fix: potential NULL dereference of ctf_fs_file path
authorJérémie Galarneau <jeremie.galarneau@efficios.com>
Sat, 27 May 2017 18:48:20 +0000 (14:48 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Sun, 28 May 2017 16:57:45 +0000 (12:57 -0400)
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
plugins/ctf/fs-src/file.c

index 0d0ed7e0a21ddb66143260b05920c815028def25..61a724b01fb18a8953b3d5e73692812fe84b76e8 100644 (file)
@@ -45,11 +45,13 @@ void ctf_fs_file_destroy(struct ctf_fs_file *file)
        ctf_fs = file->ctf_fs;
 
        if (file->fp) {
-               PDBG("Closing file \"%s\" (%p)\n", file->path->str, file->fp);
+               PDBG("Closing file \"%s\" (%p)\n",
+                               file->path ? file->path->str : NULL, file->fp);
 
                if (fclose(file->fp)) {
-                       PERR("Cannot close file \"%s\": %s\n", file->path->str,
-                               strerror(errno));
+                       PERR("Cannot close file \"%s\": %s\n",
+                                       file->path ? file->path->str : "NULL",
+                                       strerror(errno));
                }
        }
 
This page took 0.026368 seconds and 4 git commands to generate.