mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 07:38:10 +00:00
AK/ByteBuffer+Everywhere: Handle errors in ByteBuffer::slice()
This commit is contained in:
parent
c0486f93d4
commit
c10d48b72c
12 changed files with 45 additions and 34 deletions
|
@ -202,7 +202,7 @@ constexpr static int USER_VALUES_OFFSET = 32;
|
|||
ErrorOr<void> Heap::read_zero_block()
|
||||
{
|
||||
auto buffer = TRY(read_block(0));
|
||||
auto file_id_buffer = buffer.slice(0, FILE_ID.length());
|
||||
auto file_id_buffer = TRY(buffer.slice(0, FILE_ID.length()));
|
||||
auto file_id = StringView(file_id_buffer);
|
||||
if (file_id != FILE_ID) {
|
||||
warnln("{}: Zero page corrupt. This is probably not a {} heap file"sv, name(), FILE_ID);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue