From 0a992d41c2eaa7f201d5c3d9b7176561ce6efe81 Mon Sep 17 00:00:00 2001 From: Marcus Holland-Moritz Date: Sun, 28 Mar 2021 10:25:30 +0200 Subject: [PATCH] Fix image offset calculation with early matches --- src/dwarfs/filesystem_v2.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/dwarfs/filesystem_v2.cpp b/src/dwarfs/filesystem_v2.cpp index 6fb07908..e73bd09c 100644 --- a/src/dwarfs/filesystem_v2.cpp +++ b/src/dwarfs/filesystem_v2.cpp @@ -72,8 +72,8 @@ class filesystem_parser { break; } - off_t pos = - static_cast(pc) - static_cast(ps); + off_t pos = start + static_cast(pc) - + static_cast(ps); if (pos + sizeof(file_header) >= mm.size()) { break;