[PATCH, applied] elf-reader: Avoid crashing when looking at non-existing variable symbol

Dodji Seketeli dodji@redhat.com
Thu May 9 22:32:09 GMT 2024


Hello,

	* src/abg-elf-reader.cc (reader::variable_symbol_is_exported): Do
	not crash when the symbol we are looking at is non-present.

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

diff --git a/src/abg-elf-reader.cc b/src/abg-elf-reader.cc
index 80720716..610f8617 100644
--- a/src/abg-elf-reader.cc
+++ b/src/abg-elf-reader.cc
@@ -874,7 +874,7 @@ elf_symbol_sptr
 reader::variable_symbol_is_exported(const string& name) const
 {
   const elf_symbol_sptr s  = symtab()->variable_symbol_is_exported(name);
-  if (s->is_variable() && s->is_public())
+  if (s && s->is_variable() && s->is_public())
     {
       bool looking_at_linux_kernel_binary =
 	(load_in_linux_kernel_mode()
-- 
2.39.3


-- 
		Dodji



More information about the Libabigail mailing list