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
F14071634: D19783.id.diff
Wed, Nov 20, 6:04 PM
Unknown Object (File)
Fri, Oct 25, 8:09 AM
Unknown Object (File)
Oct 21 2024, 9:54 AM
Unknown Object (File)
Oct 15 2024, 7:11 PM
Unknown Object (File)
Oct 9 2024, 10:32 AM
Unknown Object (File)
Sep 28 2024, 3:09 AM
Unknown Object (File)
Sep 13 2024, 11:06 AM
Unknown Object (File)
Sep 13 2024, 2:09 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
Branch
qobject3
Lint
Lint Passed
Unit
Tests Passed
Build Status
Buildable 21098
Build 28674: Run Core Tests
Build 28673: arc lint + arc unit