mirror of
https://github.com/morluto/rea.git
synced 2026-11-16 19:53:50 +00:00
refactor(native): report bounded string reads that stop at their allowance as decode limits (#11174)
* refactor(native): report bounded string reads that stop at their allowance as decode limits * fix(verify): count generic and multi-line plain-Error limit classes
This commit is contained in:
1 parent
011cd93619
commit
6eb0e3dac6
12 files changed
+124
-47
No files matched your search
@@ -1,7 +1,7 @@
|
||||
import { observeElfStringTableEntry } from "../../domain/elfStringTable.js";
|
||||
import {
|
||||
BinaryFormatFailure,
|
||||
BinaryStringReadLimitFailure,
|
||||
binaryStringReadLimit,
|
||||
} from "./BinaryContainer.js";
|
||||
|
||||
/** Read exact string-table bytes; ELF does not prescribe a character encoding. */
|
||||
@@ -14,7 +14,7 @@ export const readElfStringBytes = (bytes: Buffer, offset: number): Buffer => {
|
||||
);
|
||||
if (observed.state === "truncated") {
|
||||
if (offset + observed.examinedBytes < bytes.length)
|
||||
throw new BinaryStringReadLimitFailure(observed.examinedBytes);
|
||||
throw binaryStringReadLimit(observed.examinedBytes);
|
||||
throw new BinaryFormatFailure(
|
||||
"malformed",
|
||||
"ELF string is unterminated inside its string table",
|
||||
|
||||
Reference in new issue
Block a user