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
F15465676: D19783.diff
Wed, Apr 2, 9:49 PM
F15457015: D19783.id47249.diff
Sun, Mar 30, 1:41 PM
F15444554: D19783.diff
Thu, Mar 27, 10:03 AM
F15438202: D19783.id47286.diff
Tue, Mar 25, 11:44 PM
F15431807: D19783.id.diff
Mon, Mar 24, 2:37 PM
F15427277: D19783.diff
Sun, Mar 23, 1:30 PM
F15381699: D19783.diff
Fri, Mar 14, 8:58 AM
Unknown Object (File)
Feb 19 2025, 6:27 PM
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
Branch
qobject3
Lint
Lint Passed
Unit
Tests Passed
Build Status
Buildable 21098
Build 28674: Run Core Tests
Build 28673: arc lint + arc unit