mirror of
https://github.com/morluto/rea.git
synced 2026-11-15 03:02:56 +00:00
fix(entropy): name offset when the byte window starts past EOF (#6495)
Fixes #6482 Co-authored-by: Abelo9996 <Abelo9996@users.noreply.github.com>
This commit is contained in:
1 parent
8f91e60558
commit
e8dad898da
3 files changed
+23
-2
No files matched your search
@@ -202,8 +202,13 @@ export class ByteEntropyService {
|
||||
"path",
|
||||
"File size exceeds exact numeric offset representation.",
|
||||
);
|
||||
if (input.offset > size)
|
||||
throw invalid(
|
||||
"offset",
|
||||
"Selected byte window starts beyond the end of the file.",
|
||||
);
|
||||
const length = input.length ?? size - input.offset;
|
||||
if (input.offset > size || length > size - input.offset)
|
||||
if (length > size - input.offset)
|
||||
throw invalid(
|
||||
"length",
|
||||
"Selected byte window extends beyond the end of the file.",
|
||||
|
||||
Reference in new issue
Block a user