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
+9
-14
@@ -21,7 +21,7 @@ import type {
|
||||
import {
|
||||
BinaryFormatFailure,
|
||||
BinaryResourceFailure,
|
||||
BinaryStringReadLimitFailure,
|
||||
isBinaryStringReadLimit,
|
||||
} from "../native/metadata/BinaryContainer.js";
|
||||
import {
|
||||
readElfSectionDirectory,
|
||||
@@ -288,19 +288,14 @@ export class GpuInventory {
|
||||
}
|
||||
#retainFailure(row: GpuObject, cause: unknown): void {
|
||||
if (cause instanceof GpuReportCapacityFailure) throw cause;
|
||||
if (
|
||||
!(cause instanceof BinaryFormatFailure) &&
|
||||
!(cause instanceof BinaryResourceFailure) &&
|
||||
!(cause instanceof BinaryStringReadLimitFailure)
|
||||
)
|
||||
throw cause;
|
||||
row.inspection =
|
||||
cause instanceof BinaryResourceFailure ||
|
||||
cause instanceof BinaryStringReadLimitFailure
|
||||
? "capacity"
|
||||
: cause.kind === "unsupported"
|
||||
? "unsupported"
|
||||
: "malformed";
|
||||
const capacity =
|
||||
cause instanceof BinaryResourceFailure || isBinaryStringReadLimit(cause);
|
||||
if (!capacity && !(cause instanceof BinaryFormatFailure)) throw cause;
|
||||
row.inspection = capacity
|
||||
? "capacity"
|
||||
: cause.kind === "unsupported"
|
||||
? "unsupported"
|
||||
: "malformed";
|
||||
this.#objectLimitations(row, [cause.message]);
|
||||
}
|
||||
async #payload(
|
||||
|
||||
Reference in new issue
Block a user