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} |
||
|---|---|---|
| .. | ||
| json_unittest.cc | ||
| json.cc | ||
| json.h | ||
| str_join_unittest.cc | ||
| str_join.h | ||
| string_builder_unittest.cc | ||
| string_builder.cc | ||
| string_builder.h | ||
| string_format_unittest.cc | ||
| string_format.cc | ||
| string_format.h | ||