From bf2efcc32ffd9eee9a909ad5dc78c7215c9bae78 Mon Sep 17 00:00:00 2001 From: Serge Lamikhov-Center Date: Tue, 24 Jul 2012 00:00:11 +0300 Subject: [PATCH] Don't pass NULL pointer to set_name function --- elfio/elfio.hpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/elfio/elfio.hpp b/elfio/elfio.hpp index 2a23a09..bdbbd4f 100644 --- a/elfio/elfio.hpp +++ b/elfio/elfio.hpp @@ -343,7 +343,10 @@ class elfio string_section_accessor str_reader( sections[shstrndx] ); for ( Elf_Half i = 0; i < num; ++i ) { Elf_Word offset = sections[i]->get_name_string_offset(); - sections[i]->set_name( str_reader.get_string( offset ) ); + const char* p = str_reader.get_string( offset ); + if ( p != 0 ) { + sections[i]->set_name( p ); + } } }