commit | 879dbf96d5344660224ed54a9c7e37470a03532f | [log] [tgz] |
---|---|---|
author | Wyatt Hepler <hepler@google.com> | Wed Sep 20 04:08:22 2023 +0000 |
committer | CQ Bot Account <pigweed-scoped@luci-project-accounts.iam.gserviceaccount.com> | Wed Sep 20 04:08:22 2023 +0000 |
tree | b2d4a413c8eb40588326330deb65ffedea811830 | |
parent | 8a618cbb8f45ea7c1c19c97a8838e96088770333 [diff] |
pw_string: Fix signed integer overflow std::abs() fails for the minimum valued integer, since its absolute value cannot be represented as a signed integer. Cast to uint64_t before negating the value to avoid this. Fixes: b/298647705 Change-Id: I5102122814a77653e407bc8229bc6ea3d3091fbb Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/171839 Commit-Queue: Wyatt Hepler <hepler@google.com> Reviewed-by: Ted Pudlik <tpudlik@google.com> Pigweed-Auto-Submit: Wyatt Hepler <hepler@google.com>
Pigweed is an open source collection of embedded-targeted libraries–or as we like to call them, modules. These modules are building blocks and infrastructure that enable faster and more reliable development on small-footprint MMU-less 32-bit microcontrollers like the STMicroelectronics STM32L452 or the Nordic nRF52832.
For more information please see our website: https://pigweed.dev/.