Page MenuHomePhorge

Fix PHP 8.2 "strlen(null)" exceptions block rendering Differential Revision page (T15432 - 2/2)
AbandonedPublic

Authored by mturdus on Jun 1 2023, 19:57.

Details

Summary

strlen() does not accept null as parameter
preg_match() does not accept null as parameter 2 and 3
substr() does not accept null as parameter 1
Closes T15432 partially: Phorge also needs some fixes

Test Plan

See Task description T15432

Diff Detail

Repository
rARC Arcanist
Branch
merula
Lint
No Lint Coverage
Unit
No Test Coverage
Build Status
Buildable 497
Build 497: arc lint + arc unit

Event Timeline

mturdus requested review of this revision.Jun 1 2023, 19:57
externals/jsonlint/src/Seld/JsonLint/JsonParser.php
484

✅ Verified: this involves a PHP pitfall (string with zero) that is OK here, since this tries to match a ByteOrderMark.

externals/jsonlint/src/Seld/JsonLint/Lexer.php
97

🔶 This involves the PHP pitfall "zero string" that is evaluated as falsy so it's skipped. Can be a problem here.

NOTE: already fixed by D25250
132

Thanks for this patch

🔴 The $match should be removed from the condition.

Thanks for this patch :)

I'm quite sure that D25250 (that is a bit older) covers all of the proposed checks, somehow in a safer way.

Do you want to share some feedback there?

In the meanwhile let's mark this as "requested changes", but it really means "probably not necessary"

externals/jsonlint/src/Seld/JsonLint/JsonParser.php
484
NOTE: Already fixed in D25250
externals/jsonlint/src/Seld/JsonLint/Lexer.php
132
NOTE: already fixed in: D25250
This revision now requires changes to proceed.Jun 2 2023, 14:22
aklapper abandoned this revision.
aklapper added a reviewer: mturdus.

All three changes superseded by D25250 in my understanding. If not, then please reopen. Thanks!

aklapper edited reviewers, added: aklapper; removed: mturdus.