webrtc/rtc_base/strings
Tommi 5e177d2171 Harden SimpleStringBuilder safety checks
Replace RTC_DCHECK with RTC_CHECK in SimpleStringBuilder to ensure
safety constraints are enforced in all build configurations, including
release builds. This change prevents undefined behavior or silent
truncation by crashing when a buffer overflow is detected, rather than
only performing these checks in debug modes.

The modifications include:
* Updating SimpleStringBuilder to use RTC_CHECK for consistency and
  bounds verification.
* Simplifying RtpExtension::ToString and VideoReceiveStream2 by
  migrating from SimpleStringBuilder to StringBuilder.
* Simplify+clarify the StringBuilder::Release implementation.
* Update unit tests to reflect that overflow now consistently results
  in a crash.

Bug: chromium:486536241
Change-Id: Ia067508e2b9409154ad4afdbe4c0971a1dd32e1e
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/459441
Commit-Queue: Tomas Gunnarsson <tommi@webrtc.org>
Reviewed-by: Per Kjellander <perkj@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#47251}
2026-03-25 01:02:30 -07:00
..
json_unittest.cc IWYU rtc_base 2025-06-17 23:41:21 -07:00
json.cc Modernize deprecated headers in api/, pc/ and rtc_base/ 2025-07-21 00:02:35 -07:00
json.h Use injected clock in rtp_replayer 2025-08-25 05:59:39 -07:00
str_join_unittest.cc IWYU rtc_base 2025-06-17 23:41:21 -07:00
str_join.h Move string_builder.h to webrtc namespace 2025-02-19 06:30:53 -08:00
string_builder_unittest.cc Harden SimpleStringBuilder safety checks 2026-03-25 01:02:30 -07:00
string_builder.cc Harden SimpleStringBuilder safety checks 2026-03-25 01:02:30 -07:00
string_builder.h Harden SimpleStringBuilder safety checks 2026-03-25 01:02:30 -07:00
string_format_unittest.cc IWYU rtc_base 2025-06-17 23:41:21 -07:00
string_format.cc IWYU rtc_base 2025-06-17 23:41:21 -07:00
string_format.h Remove re-exported symbols from rtc and cricket namespaces 2025-07-01 03:58:20 -07:00