1
Fork 0
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:
Matthias Zimmerman 2022-06-13 05:20:42 -07:00 committed by Linus Groh
parent c0486f93d4
commit c10d48b72c
12 changed files with 45 additions and 34 deletions

View file

@ -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);