Page MenuHomePhabricator

In "phutil_loggable_string()", encode every byte above 0x7F
ClosedPublic

Authored by epriestley on Apr 14 2020, 9:52 PM.
Tags
None
Referenced Files
Unknown Object (File)
Wed, Nov 20, 2:07 AM
Unknown Object (File)
Wed, Nov 20, 1:54 AM
Unknown Object (File)
Tue, Nov 19, 11:18 AM
Unknown Object (File)
Oct 16 2024, 6:44 PM
Unknown Object (File)
Oct 14 2024, 11:05 PM
Unknown Object (File)
Sep 21 2024, 3:43 AM
Unknown Object (File)
Sep 20 2024, 3:49 AM
Unknown Object (File)
Sep 17 2024, 3:49 PM
Subscribers
None

Details

Summary

Ref T13507. Currently, this function is a bit conservative about what it encodes, and passing it a string of binary garbage may result in an output which is not valid UTF8.

This could be refined somewhat, since it's less than ideal if the input has valid UTF8. The ideal behavior for byte sequences where all bytes are larger than 0x7F is probably a variation of "phutil_utf8ize()" that replaces bytes with "<0xXX>" instead of the Unicode error glyph.

For now, just err on the side of mangling.

Test Plan

Dumped various binary payloads in the new gzip setup check, saw sensible output in the web UI.

Diff Detail

Repository
rARC Arcanist
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

This revision was not accepted when it landed; it landed in state Needs Review.Apr 14 2020, 11:03 PM
This revision was automatically updated to reflect the committed changes.