Page MenuHomePhabricator

Support %LA (AND), %LO (OR) and %LQ (comma) conversions for qsprintf() to improve safety
ClosedPublic

Authored by epriestley on Nov 7 2018, 12:45 AM.
Tags
None
Referenced Files
F18764586: D19783.id.diff
Tue, Oct 7, 6:44 AM
F18757726: D19783.id.diff
Sun, Oct 5, 7:12 PM
F18746646: D19783.id.diff
Fri, Oct 3, 1:02 PM
F18737749: D19783.diff
Wed, Oct 1, 12:24 PM
F18619214: D19783.diff
Sep 15 2025, 1:59 AM
F18568712: D19783.id47286.diff
Sep 10 2025, 12:23 AM
F18568711: D19783.id47249.diff
Sep 10 2025, 12:23 AM
F18509913: D19783.id.diff
Sep 5 2025, 3:40 AM
Subscribers
None

Details

Summary

Depends on D19782. Ref T13217. Ref T13216. Ref T6960. We currently construct some queries by passing implode(...) directly to qsprintf().

I believe we can cover all these cases (or, at least, almost all these cases) with conversions for imploding on AND, OR, or comma. This will ultimately let us make %Q safer.

Test Plan

Played around with these in a toy qsprintf() script; upcoming changes will convert Phabricator callsites more aggressively.

Diff Detail

Repository
rPHU libphutil
Lint
Lint Not Applicable
Unit
Tests Not Applicable