base: avoid null pointer reference warning

Issue #3022
This commit is contained in:
Alexander Boettcher 2018-10-30 10:42:37 +01:00 committed by Norman Feske
parent 518d157f76
commit 67fd3333e2
2 changed files with 3 additions and 2 deletions

View File

@ -198,7 +198,8 @@ class Genode::Msgbuf_base : Noncopyable
if (_data_size + num_bytes > _capacity) return;
/* copy buffer */
memcpy(_data_last(), src_addr, num_bytes);
if (src_addr && num_bytes)
memcpy(_data_last(), src_addr, num_bytes);
/* increment write pointer to next dword-aligned value */
_data_size += align_natural(num_bytes);

View File

@ -170,7 +170,7 @@ class Linker::Reloc_jmpslot_generic
}
}
Elf::Addr target_addr() const { return *_addr; }
Elf::Addr target_addr() const { return _addr ? *_addr : 0; }
};