This is the mail archive of the elfutils-devel@sourceware.org mailing list for the elfutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH 1/4] libdwfl: Check file_name is not NULL before calling canonicalize_file_name.


canonicalize_file_name is marked as taking a nonnull argument.

Signed-off-by: Mark Wielaard <mjw@redhat.com>
---
 libdwfl/ChangeLog        | 5 +++++
 libdwfl/find-debuginfo.c | 2 +-
 2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/libdwfl/ChangeLog b/libdwfl/ChangeLog
index dec3405..ffb34c0 100644
--- a/libdwfl/ChangeLog
+++ b/libdwfl/ChangeLog
@@ -1,3 +1,8 @@
+2015-05-30  Mark Wielaard  <mjw@redhat.com>
+
+	* find-debuginfo.c (dwfl_standard_find_debuginfo): Check file_name is
+	not NULL before calling canonicalize_file_name.
+
 2015-05-24  Mark Wielaard  <mjw@redhat.com>
 
 	* derelocate.c (check_module): Check mod is not NULL.
diff --git a/libdwfl/find-debuginfo.c b/libdwfl/find-debuginfo.c
index ac9a5e5..9b911c1 100644
--- a/libdwfl/find-debuginfo.c
+++ b/libdwfl/find-debuginfo.c
@@ -357,7 +357,7 @@ dwfl_standard_find_debuginfo (Dwfl_Module *mod,
 				   debuglink_file, debuglink_crc,
 				   debuginfo_file_name);
 
-  if (fd < 0 && errno == 0)
+  if (fd < 0 && errno == 0 && file_name != NULL)
     {
       /* If FILE_NAME is a symlink, the debug file might be associated
 	 with the symlink target name instead.  */
-- 
2.1.0


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]