1
0
Fork 0
mirror of https://we.phorge.it/source/arcanist.git synced 2024-11-24 15:52:40 +01:00

Fix $boot_length comparison in PhagePHPAgentBootloader

Summary: `$boot_length = strlen($boot_sequence->toString())` returns an `int` and `strlen()` expects a `string` as a parameter. Thus calling `if (strlen($boot_length) > 8192)` afterwards to get the string length of an integer makes no sense.

Test Plan: Read the code.

Reviewers: O1 Blessed Committers, valerio.bozzolan

Reviewed By: O1 Blessed Committers, valerio.bozzolan

Subscribers: tobiaswiese, valerio.bozzolan, Matthew, Cigaryno

Differential Revision: https://we.phorge.it/D25770
This commit is contained in:
Andre Klapper 2024-08-11 22:48:18 +02:00
parent 06028fad3c
commit 4752567130

View file

@ -89,7 +89,7 @@ final class PhagePHPAgentBootloader extends PhageAgentBootloader {
$boot_length = strlen($boot_sequence->toString());
$boot_sequence->addText($main_sequence->toString());
if (strlen($boot_length) > 8192) {
if ($boot_length > 8192) {
throw new Exception(pht('Stage 1 bootloader is too large!'));
}