HomePhorge

Fix DifferentialGetCommitMessageConduitAPIMethod execute strlen(null)

Description

Fix DifferentialGetCommitMessageConduitAPIMethod execute strlen(null)

Summary:
When iterating through the fields of a differential commit, the DifferentialGetCommitMessageConduitAPIMethod execute method explicitly allows a value to be either a string or a null. It then calls strlen upon this possibly null value.

We could replace the strlen with phutil_nonempty_string, but as the code has already eliminated variable types other than string or null, it is more efficient to explicitly check for null or ''

$value === null or $value == ''

Fixes T15527

Test Plan:
Run

arc diff

Reviewers: O1 Blessed Committers, valerio.bozzolan

Reviewed By: O1 Blessed Committers, valerio.bozzolan

Subscribers: speck, tobiaswiese, valerio.bozzolan, Matthew, Cigaryno

Maniphest Tasks: T15527

Differential Revision: https://we.phorge.it/D25332

Details

Provenance
Steve CampbellAuthored on Jul 5 2023, 1:08 AM
themackabuPushed on Mar 25 2025, 8:07 PM
Parents
rPd5a28e12a005: Project Hovercards: Show Description
Branches
Unknown
Tags
Unknown

Event Timeline