Commits

a4z committed 5935e6c

add checks for regular file befor reading

Comments (0)

Files changed (2)

src/sbbdep/elffile.cpp

 
 #include <sbbdep/elffile.hpp>
 #include <sbbdep/log.hpp>
+#include <sbbdep/path.hpp>
 
 #include <elfio/elfio.hpp>
 
 void
 ElfFile::load()
 {
+  // firewall against invalid pathnames
+  if(not Path(m_name).isRegularFile())
+    return ;
 
   ELFIO::elfio elfreader;
 
         // place a warning here if file still not exists...
         if ( !p.isValid() ) LogInfo() << "Note: indexing file " << p << ": file not found\n" ;
       }
+
+    if(p.isRegularFile())
       {
         ElfFile elfile(p);
         if( elfile.isBinaryOrLibrary() )