Skip to content

Commit

Permalink
Check for failed seek when skipping x86 xstate data
Browse files Browse the repository at this point in the history
After reading minidump context with x86 xstate data, we seek past it, so
there needs to be a check to see that the seek operation did not fail.

Change-Id: I8ed4394e452c435234116d97fd65856345cb618a
Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/5324600
Reviewed-by: Mike Frysinger <[email protected]>
  • Loading branch information
nmoinvaz authored and Ivan Penkov committed Mar 12, 2024
1 parent f032e4c commit 26666b8
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/processor/minidump.cc
Original file line number Diff line number Diff line change
Expand Up @@ -903,8 +903,12 @@ bool MinidumpContext::Read(uint32_t expected_size) {

// Skip extended xstate data if present in X86 context.
if (context_flags & MD_CONTEXT_X86_XSTATE) {
minidump_->SeekSet((minidump_->Tell() - sizeof(MDRawContextX86)) +
expected_size);
if (!minidump_->SeekSet(
(minidump_->Tell() - sizeof(MDRawContextX86)) +
expected_size)) {
BPLOG(ERROR) << "MinidumpContext cannot seek to past xstate data";
return false;
}
}

break;
Expand Down

0 comments on commit 26666b8

Please sign in to comment.