commit | 6dbf91509a7c6975a5693f7b0d8f8e42851742b0 | [log] [tgz] |
---|---|---|
author | Aaron Green <aarongreen@google.com> | Thu Jan 18 18:58:44 2024 +0000 |
committer | CQ Bot Account <pigweed-scoped@luci-project-accounts.iam.gserviceaccount.com> | Thu Jan 18 18:58:44 2024 +0000 |
tree | 05b090c61508fb4f062cf58e1fd27745edc6d388 | |
parent | 580207197edbf60c0a1f7c03e863b839a4cd5576 [diff] |
pw_protobuf: Fix out-of-range read A failed `varint::Read` led to a nested decoder's position to not be updated when the stream was (partially) advanced. This led to destructor reading past the end of the stream when `CloseNestedDecoder` was invoked. To fix this, `varint::Read` now always returns the number of bytes read and `StreamDecoder` always updates its position, even on error. Bug: b/314803709 Change-Id: Id07ea172030ada376d5ce1ce3844e0014edbe4dc Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/188095 Reviewed-by: Armando Montanez <amontanez@google.com> Commit-Queue: Aaron Green <aarongreen@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/.