diff options
author | Gavin Howard <gavin@yzena.com> | 2021-07-24 22:50:03 -0600 |
---|---|---|
committer | Gavin Howard <gavin@yzena.com> | 2021-07-24 22:50:03 -0600 |
commit | dfc16a348f6bcf8abaac3fc1002fd371d7d5f3c1 (patch) | |
tree | 33f041f2895f4048eda457a359f38c8582255bf5 /src | |
parent | fec58029cec8e9056c8081aef8e2c2053b6a64b0 (diff) | |
download | platform_external_bc-dfc16a348f6bcf8abaac3fc1002fd371d7d5f3c1.tar.gz platform_external_bc-dfc16a348f6bcf8abaac3fc1002fd371d7d5f3c1.tar.bz2 platform_external_bc-dfc16a348f6bcf8abaac3fc1002fd371d7d5f3c1.zip |
Fix an uninitialized data error in history
This was found by MSan.
Signed-off-by: Gavin Howard <gavin@yzena.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/history.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/history.c b/src/history.c index 6da3d9a0..83577cd7 100644 --- a/src/history.c +++ b/src/history.c @@ -482,7 +482,7 @@ static size_t bc_history_colPos(const char *buf, size_t buf_len, size_t pos) { size_t ret = 0, off = 0; // While we haven't reached the offset, get the length of the next grapheme. - while (off < pos) { + while (off < pos && pos < buf_len) { size_t col_len, len; |