diff options
author | Alexis211 <alexis211@gmail.com> | 2009-11-24 14:29:29 +0100 |
---|---|---|
committer | Alexis211 <alexis211@gmail.com> | 2009-11-24 14:29:29 +0100 |
commit | f3ffe96d679742af95afa29e0cf612c6935eedd0 (patch) | |
tree | 94b401da87240ab83216a6a147ff99df6aef8d5d /Source/Kernel/Linker | |
parent | 0f536540de15202d44cd9b1d708ee04edccb8c66 (diff) | |
download | Melon-f3ffe96d679742af95afa29e0cf612c6935eedd0.tar.gz Melon-f3ffe96d679742af95afa29e0cf612c6935eedd0.zip |
Reading from floppys supposedly fixed in qemu
Diffstat (limited to 'Source/Kernel/Linker')
-rw-r--r-- | Source/Kernel/Linker/ElfBinary.class.cpp | 2 | ||||
-rw-r--r-- | Source/Kernel/Linker/MelonBinary.class.cpp | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/Source/Kernel/Linker/ElfBinary.class.cpp b/Source/Kernel/Linker/ElfBinary.class.cpp index 27e5474..0518c38 100644 --- a/Source/Kernel/Linker/ElfBinary.class.cpp +++ b/Source/Kernel/Linker/ElfBinary.class.cpp @@ -9,7 +9,7 @@ ElfBinary::~ElfBinary() { Binary* ElfBinary::load(File& file) { elf_ehdr_t hdr; - file.read<elf_ehdr_t> (&hdr); + if (!file.read<elf_ehdr_t> (&hdr)) return 0; //Verify we have an elf file if (hdr.e_ident[0] != 0x7F or hdr.e_ident[1] != 'E' or hdr.e_ident[2] != 'L' or hdr.e_ident[3] != 'F') return 0; diff --git a/Source/Kernel/Linker/MelonBinary.class.cpp b/Source/Kernel/Linker/MelonBinary.class.cpp index 0737b71..8a85977 100644 --- a/Source/Kernel/Linker/MelonBinary.class.cpp +++ b/Source/Kernel/Linker/MelonBinary.class.cpp @@ -2,7 +2,7 @@ Binary* MelonBinary::load(File& file) { u32int magic; - file.read<u32int>(&magic); + if (!file.read<u32int>(&magic)) return 0; if (magic == 0xFEEDBEEF) { MelonBinary* r = new MelonBinary; file.read<u32int>(&r->m_size); |