This is an archive of the discontinued LLVM Phabricator instance.

[lldb] Add a Stream variant that escapes null bytes
AbandonedPublic

Authored by JDevlieghere on Mar 22 2022, 9:19 PM.

Details

Reviewers
jingham
labath
Summary

In D122025 Jim suggested that we should sanitize the input to the command return object to retain the guarantee that we don't have null bytes in the output. This patch implements that through a Stream wrapper that escapes null bytes.

Diff Detail

Event Timeline

JDevlieghere created this revision.Mar 22 2022, 9:19 PM
Herald added a project: Restricted Project. · View Herald TranscriptMar 22 2022, 9:19 PM
JDevlieghere requested review of this revision.Mar 22 2022, 9:19 PM
jingham accepted this revision.Mar 23 2022, 9:55 AM

Nice! Thanks for doing this.

This revision is now accepted and ready to land.Mar 23 2022, 9:55 AM

Although I can't say exactly what would be the problem with this, this seems like a strange thing to do, and I'm not aware of any other stream class which would handle nul (and _only_ nul) characters specially.

JDevlieghere abandoned this revision.Jul 6 2022, 11:12 AM