diff options
author | 2024-02-14 09:54:47 -0800 | |
---|---|---|
committer | 2024-02-14 09:56:30 -0800 | |
commit | 4618865caf8596742a9fd7c28a70a46b5e277794 (patch) | |
tree | 948b23d4de133f5b891e43b30b546890cd40769c /absl/algorithm | |
parent | c14dfbf9c1759c39bf4343b9e54a43975fbba930 (diff) |
Prevent overflow in `absl::CEscape()`
Strings larger than 1 GiB on a platform with a 32-bit size_t could
potentially overflow size_t in `CEscapedLength()`, resulting in an
undersized allocation. The resulting write in
`CEscapeAndAppendInternal()` would then write beyond the bounds of the
output buffer.
A second overflow, where the calculated escaped length is added to the
size of the string being appended to, is also fixed.
In both cases the program will now abort prior to the overflow.
Credit goes to Ronald Crane (Zippenhop LLC) for reporting this issue.
PiperOrigin-RevId: 607019573
Change-Id: I97bf246cde96102a793d2db49446cccae08abf59
Diffstat (limited to 'absl/algorithm')
0 files changed, 0 insertions, 0 deletions