mirror of
https://github.com/Telecominfraproject/OpenCellular.git
synced 2025-12-27 18:25:05 +00:00
We read a counted string (byte 0 = count, bytes 1 - count = chars) and
convert it to a null-terminated string. Since both have a 1-byte
overhead, we can use the destination buffer instead of using a
stack-based buffer.
BUG=chrome-os-partner:23928
BRANCH=none (pit is affected, but battery console command isn't used on
end user systems)
TEST=battery command shows correct strings (SDI / 4302D40 / LiP), and doesn't
stack overflow.
Change-Id: Ic0f111cde2d57b41d6ce9287e0c771acc09a8869
Signed-off-by: Randall Spangler <rspangler@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/176116
Reviewed-by: Bill Richardson <wfrichar@chromium.org>