GP-7174/7175: Fixing string formatter

This commit is contained in:
Ryan Kurtz
2026-08-31 07:02:26 -04:00
parent 0423f95d0f
commit fef3f4c9a5
3 changed files with 4 additions and 4 deletions

View File

@@ -147,7 +147,7 @@ public class BindingTable extends OpcodeTable {
ulebOffsets.add(reader.getPointerIndex() - origIndex);
long count = reader.readNext(LEB128::unsigned);
if (count < 0 || count > COUNT_LIMIT) {
throw new MachException("BIND_OPCODE count exceeds limit (%s): %s"
throw new MachException("BIND_OPCODE count exceeds limit (%d): %d"
.formatted(COUNT_LIMIT, count));
}
ulebOffsets.add(reader.getPointerIndex() - origIndex);

View File

@@ -100,7 +100,7 @@ public class RebaseTable extends OpcodeTable {
ulebOffsets.add(reader.getPointerIndex() - origIndex);
int count = reader.readNextUnsignedVarIntExact(LEB128::unsigned);
if (count < 0 || count > COUNT_LIMIT) {
throw new MachException("REBASE_OPCODE count exceeds limit (%s): %s"
throw new MachException("REBASE_OPCODE count exceeds limit (%d): %d"
.formatted(COUNT_LIMIT, count));
}
for (int i = 0; i < count; ++i) {
@@ -119,7 +119,7 @@ public class RebaseTable extends OpcodeTable {
ulebOffsets.add(reader.getPointerIndex() - origIndex);
int count = reader.readNextUnsignedVarIntExact(LEB128::unsigned);
if (count < 0 || count > COUNT_LIMIT) {
throw new MachException("REBASE_OPCODE count exceeds limit (%s): %s"
throw new MachException("REBASE_OPCODE count exceeds limit (%d): %d"
.formatted(COUNT_LIMIT, count));
}
ulebOffsets.add(reader.getPointerIndex() - origIndex);

View File

@@ -42,7 +42,7 @@ public class AndroidBootLoaderHeader implements StructConverter {
magic = reader.readNextAsciiString(AndroidBootLoaderConstants.BOOTLDR_MAGIC_SIZE);
numberOfImages = reader.readNextInt();
if (numberOfImages < 0 || numberOfImages > NUM_IMAGES_LIMIT) {
throw new IOException("Image count exceeds limit (%s): %s"
throw new IOException("Image count exceeds limit (%d): %d"
.formatted(NUM_IMAGES_LIMIT, numberOfImages));
}
startOffset = reader.readNextInt();