mirror of
https://github.com/morluto/rea.git
synced 2026-12-06 14:59:05 +00:00
refactor(labview): reuse the checked section table extent (#17171)
This commit is contained in:
1 parent
18c8664072
commit
03004ec6ba
1 file changed
+3
-11
@@ -388,7 +388,8 @@ export const parseLabviewRsrc = (
|
||||
"RSRC section-start table overlaps the block headers",
|
||||
{ offset: headerAt + 8, field: identifier },
|
||||
);
|
||||
if (!inside(startsAt, sectionCount * SECTION_START_BYTES, listEnd))
|
||||
const tableBytes = sectionCount * SECTION_START_BYTES;
|
||||
if (!inside(startsAt, tableBytes, listEnd))
|
||||
throw truncatedInput(FORMAT, "truncated RSRC section starts", {
|
||||
offset: startsAt,
|
||||
field: identifier,
|
||||
@@ -416,17 +417,8 @@ export const parseLabviewRsrc = (
|
||||
),
|
||||
{ offset: headerAt + 4, field: identifier },
|
||||
);
|
||||
namesBase = Math.max(
|
||||
namesBase,
|
||||
startsAt + sectionCount * SECTION_START_BYTES,
|
||||
);
|
||||
namesBase = Math.max(namesBase, startsAt + tableBytes);
|
||||
}
|
||||
if (namesBase > listEnd)
|
||||
throw truncatedInput(
|
||||
FORMAT,
|
||||
"RSRC section-name list exceeds the declared list",
|
||||
{ offset: namesBase },
|
||||
);
|
||||
|
||||
for (let blockIndex = 0; blockIndex < blockCount; blockIndex += 1) {
|
||||
const headerAt = blockHeadersAt + blockIndex * BLOCK_HEADER_BYTES;
|
||||
|
||||
Reference in new issue
Block a user