Explorar el Código

readelf: Fall back to default interpreter path on empty path

This fixes readelf failing to map the interpreter for dynamic
libraries. When an ELF does not have the PT_INTERP header the
StringView will be of the inline capacity of the StringBuilder, not a
null StringView. This would cause readelf not to fallback on the
default interpreter path.
Thijs Waalen hace 3 años
padre
commit
6210f62b1d
Se han modificado 1 ficheros con 1 adiciones y 1 borrados
  1. 1 1
      Userland/Utilities/readelf.cpp

+ 1 - 1
Userland/Utilities/readelf.cpp

@@ -311,7 +311,7 @@ int main(int argc, char** argv)
     RefPtr<ELF::DynamicObject> object = nullptr;
 
     if (elf_image.is_dynamic()) {
-        if (interpreter_path.is_null()) {
+        if (interpreter_path.is_empty()) {
             interpreter_path = "/usr/lib/Loader.so"sv;
             warnln("Warning: Dynamic ELF object has no interpreter path. Using: {}", interpreter_path);
         }