fix(artifacts): keep cpio checksum evidence and bound xar TOC elements (#1082)
Record-and-continue used to catch integrity exceptions and keep only the message, so directory, symlink, special-node, and zero-size link CRC failures dropped the declared and observed sums. One checksum check now returns that observation for every member kind. A TOC within the byte cap can still contain millions of elements. Count elements before building the DOM and fail with a tagged limit. Co-authored-by: Cursor Agent <cursoragent@cursor.com>
This commit is contained in:
@@ -12,6 +12,7 @@ import {
|
||||
} from "./ArtifactDecodedBudget.js";
|
||||
import { artifactStreamPipeline } from "./ArtifactStreamPipeline.js";
|
||||
import {
|
||||
assertXarTocElements,
|
||||
xarInteger as integer,
|
||||
xarHeapPosition,
|
||||
XarPathBudget,
|
||||
@@ -486,6 +487,7 @@ export class XarArtifactReader implements ArtifactReader {
|
||||
{ cause },
|
||||
);
|
||||
}
|
||||
assertXarTocElements(xml);
|
||||
} catch (cause: unknown) {
|
||||
if (cause instanceof ArtifactReaderFailure) throw cause;
|
||||
throw new ArtifactReaderFailure("format", "xar TOC is not zlib data", {
|
||||
|
||||
Reference in New Issue
Block a user