From acdd772db05b2d0a35415f7da2bc767bf3cd2d16 Mon Sep 17 00:00:00 2001 From: Augustin Cavalier Date: Mon, 25 Apr 2022 19:16:28 -0400 Subject: [PATCH] DiskProbe: Check we actually have a buffer before computing the offset. Fixes #17709. --- src/apps/diskprobe/DataEditor.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/apps/diskprobe/DataEditor.cpp b/src/apps/diskprobe/DataEditor.cpp index 0b22a01171..7b44a63a6a 100644 --- a/src/apps/diskprobe/DataEditor.cpp +++ b/src/apps/diskprobe/DataEditor.cpp @@ -1062,8 +1062,10 @@ DataEditor::GetViewBuffer(const uint8 **_buffer) debugger("DataEditor: view not locked"); status_t status = UpdateIfNeeded(); - if (status < B_OK) + if (status != B_OK) return status; + if (fView == NULL) + return B_NO_INIT; *_buffer = fView + fViewOffset - fRealViewOffset; return B_OK;