diff --git a/Userland/disasm.cpp b/Userland/disasm.cpp index 3e03a5572e..3cd61907da 100644 --- a/Userland/disasm.cpp +++ b/Userland/disasm.cpp @@ -37,6 +37,10 @@ int main(int argc, char** argv) } MappedFile file(argv[1]); + if (!file.is_valid()) { + // Already printed some error message. + return 1; + } X86::SimpleInstructionStream stream((const u8*)file.data(), file.size()); X86::Disassembler disassembler(stream); diff --git a/Userland/unzip.cpp b/Userland/unzip.cpp index 93245c2ae7..7fc6bfd921 100644 --- a/Userland/unzip.cpp +++ b/Userland/unzip.cpp @@ -183,6 +183,8 @@ int main(int argc, char** argv) } MappedFile mapped_file { zip_file_path }; + if (!mapped_file.is_valid()) + return 1; printf("Archive: %s\n", zip_file_path.characters());