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
Unknown Object (File)
Fri, Dec 20, 10:34 PM
Unknown Object (File)
Sun, Dec 1, 3:56 PM
Unknown Object (File)
Wed, Nov 27, 10:37 PM
Unknown Object (File)
Sun, Nov 24, 4:20 PM
Unknown Object (File)
Sun, Nov 24, 4:18 AM
Unknown Object (File)
Nov 21 2024, 11:03 PM
Unknown Object (File)
Nov 20 2024, 6:04 PM
Unknown Object (File)
Oct 25 2024, 8: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
Lint
Lint Not Applicable
Unit
Tests Not Applicable