From dcbaa1cad50ceea9ac9ec6a7b098db5d372dcbaa Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=A9mie=20Galarneau?= Date: Sat, 27 May 2017 14:48:20 -0400 Subject: [PATCH] Fix: potential NULL dereference of ctf_fs_file path MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Jérémie Galarneau --- plugins/ctf/fs-src/file.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/plugins/ctf/fs-src/file.c b/plugins/ctf/fs-src/file.c index 0d0ed7e0..61a724b0 100644 --- a/plugins/ctf/fs-src/file.c +++ b/plugins/ctf/fs-src/file.c @@ -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)); } } -- 2.34.1