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
F15416104: D21117.id50292.diff
Thu, Mar 20, 9:18 AM
F15411658: D21117.diff
Wed, Mar 19, 9:31 AM
F15395011: D21117.diff
Sun, Mar 16, 2:34 AM
F15375697: D21117.diff
Wed, Mar 12, 11:36 PM
F15335031: D21117.diff
Sat, Mar 8, 1:51 PM
F15302671: D21117.id.diff
Wed, Mar 5, 7:43 PM
F15301108: D21117.id50293.diff
Wed, Mar 5, 5:26 PM
F15299357: D21117.diff
Wed, Mar 5, 2: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
Branch
log1
Lint
Lint Passed
Unit
Tests Passed
Build Status
Buildable 24110
Build 33196: Run Core Tests
Build 33195: arc lint + arc unit

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.