dbus: Fix dbus::MessageWriter::AppendString bug
This change fixes a bug in dbus::MessageWriter::AppendString where we
wrongly write data that is beyond the bounds of the `std::string_view`
parameter (but still within the bounds of the `std::string` it
references). This bug exists because we internally convert the
`std::string_view` to a `char*` which has no notion of size except for
where it is null-terminated. The result is that we append the data from
the start of the `std::string_view` but to the end of the `std::string`
that it references.
Bug: None
Change-Id: Iea864ca40106e386cd372aabab8225a6eafa1ef8
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5742653
Commit-Queue: Chad Duffin <chadduffin@chromium.org>
Reviewed-by: Ryo Hashimoto <hashimoto@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1337353}
NOKEYCHECK=True
GitOrigin-RevId: 61f3296548de41214ee39bca6293a5c6c21061c9
3 files changed