Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 4 additions & 20 deletions bplistParser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -257,11 +257,7 @@ export function parseBuffer<T = any>(buffer: Buffer): [T] {
const intInfo = int_type & 0x0F;
const intLength = Math.pow(2, intInfo);
dataoffset = 2 + intLength;
if (intLength < 3) {
length = readUInt(buffer.slice(offset + 2, offset + 2 + intLength));
} else {
length = readUInt(buffer.slice(offset + 2, offset + 2 + intLength));
}
length = readUInt(buffer.slice(offset + 2, offset + 2 + intLength));
}
if (length < maxObjectSize) {
return buffer.slice(offset + dataoffset, offset + dataoffset + length);
Expand All @@ -283,11 +279,7 @@ export function parseBuffer<T = any>(buffer: Buffer): [T] {
const intInfo = int_type & 0x0F;
const intLength = Math.pow(2, intInfo);
stroffset = 2 + intLength;
if (intLength < 3) {
length = readUInt(buffer.slice(offset + 2, offset + 2 + intLength));
} else {
length = readUInt(buffer.slice(offset + 2, offset + 2 + intLength));
}
length = readUInt(buffer.slice(offset + 2, offset + 2 + intLength));
}
// length is String length -> to get byte length multiply by 2, as 1 character takes 2 bytes in UTF-16
length *= (utf16Flag ? 2 : 1);
Expand All @@ -314,11 +306,7 @@ export function parseBuffer<T = any>(buffer: Buffer): [T] {
const intInfo = int_type & 0x0F;
const intLength = Math.pow(2, intInfo);
arrayoffset = 2 + intLength;
if (intLength < 3) {
length = readUInt(buffer.slice(offset + 2, offset + 2 + intLength));
} else {
length = readUInt(buffer.slice(offset + 2, offset + 2 + intLength));
}
length = readUInt(buffer.slice(offset + 2, offset + 2 + intLength));
}
if (length * objectRefSize > maxObjectSize) {
throw new Error("Too little heap space available!");
Expand All @@ -343,11 +331,7 @@ export function parseBuffer<T = any>(buffer: Buffer): [T] {
const intInfo = int_type & 0x0F;
const intLength = Math.pow(2, intInfo);
dictoffset = 2 + intLength;
if (intLength < 3) {
length = readUInt(buffer.slice(offset + 2, offset + 2 + intLength));
} else {
length = readUInt(buffer.slice(offset + 2, offset + 2 + intLength));
}
length = readUInt(buffer.slice(offset + 2, offset + 2 + intLength));
}
if (length * 2 * objectRefSize > maxObjectSize) {
throw new Error("Too little heap space available!");
Expand Down
Loading