mirror of
https://github.com/genodelabs/genode.git
synced 2025-04-07 19:34:56 +00:00
ram_fs: avoid Deref_unconstructed_object exception
if ROM is invalid. With the patch one gets a name of the ROM and the server continues.
This commit is contained in:
parent
6c723fb1e8
commit
28b359703d
@ -18,7 +18,6 @@
|
||||
#include <base/attached_rom_dataspace.h>
|
||||
#include <base/heap.h>
|
||||
#include <root/component.h>
|
||||
#include <base/attached_rom_dataspace.h>
|
||||
#include <os/session_policy.h>
|
||||
|
||||
/* local includes */
|
||||
@ -619,6 +618,9 @@ static void preload_content(Genode::Env &env,
|
||||
/* read file content from ROM module */
|
||||
try {
|
||||
Attached_rom_dataspace rom(env, name);
|
||||
if (!rom.valid())
|
||||
throw Rm_session::Attach_failed();
|
||||
|
||||
File *file = new (&alloc) File(alloc, as);
|
||||
file->write(rom.local_addr<char>(), rom.size(), 0);
|
||||
dir.adopt_unsynchronized(file);
|
||||
|
Loading…
x
Reference in New Issue
Block a user