public inbox for libabigail@sourceware.org
 help / color / mirror / Atom feed
From: Dodji Seketeli <dodji@redhat.com>
To: libabigail@sourceware.org
Subject: [PATCH, applied to mainline] tools-utils.cc: Fix potential crash when testing for CTF debug info
Date: Thu, 14 Mar 2024 16:11:44 +0100	[thread overview]
Message-ID: <87a5n0sv9r.fsf@redhat.com> (raw)

Hello,

When looking at something else, I stumbled upon a crash when testing
for the presence of CTF debug info.

	* src/abg-tools-utils.cc (file_has_ctf_debug_info): Do not crash
	on empty debug info paths.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
Applied to mainline.
---
 src/abg-tools-utils.cc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/abg-tools-utils.cc b/src/abg-tools-utils.cc
index 08d50347..2115113b 100644
--- a/src/abg-tools-utils.cc
+++ b/src/abg-tools-utils.cc
@@ -516,7 +516,7 @@ file_has_ctf_debug_info(const string& elf_file_path,
 
   // vmlinux.ctfa could be provided with --debug-info-dir
   for (const auto& path : debug_info_root_paths)
-    if (find_file_under_dir(*path, "vmlinux.ctfa", vmlinux))
+    if (path && *path && find_file_under_dir(*path, "vmlinux.ctfa", vmlinux))
       return true;
 
   return false;
-- 
2.39.3


-- 
		Dodji


                 reply	other threads:[~2024-03-14 15:11 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87a5n0sv9r.fsf@redhat.com \
    --to=dodji@redhat.com \
    --cc=libabigail@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).