[hackers] [libgrapheme] Do not falsely read entire buffer instead of simply the filled with || Laslo Hunhold
commit 4a46373ab48ea1692bbee2910295717aa416c323
Author: Laslo Hunhold <dev_AT_frign.de>
AuthorDate: Thu Nov 24 13:29:31 2022 +0100
Commit: Laslo Hunhold <dev_AT_frign.de>
CommitDate: Thu Nov 24 15:00:03 2022 +0100
Do not falsely read entire buffer instead of simply the filled with
This was caught via static analysis (clang asan), which I can definitely
recommend.
Rust evangelists might see this as a prime example for why C is bad, but
I still think the benefits outweigh the risks if you consider the
maturity of tooling to catch these kinds of errors. In an ideal world we
would all be programming in Ada, but C's portability is unmatched.
Signed-off-by: Laslo Hunhold <dev_AT_frign.de>
diff --git a/test/bidirectional.c b/test/bidirectional.c
index 8646afe..f7c6081 100644
--- a/test/bidirectional.c
+++ b/test/bidirectional.c
_AT_@ -34,7 +34,7 @@ main(int argc, char *argv[])
bidirectional_test[i].cplen,
bidirectional_test[i].mode[m], data, datalen);
grapheme_bidirectional_get_line_embedding_levels(
- data, datalen, lev);
+ data, ret, lev);
if (ret != bidirectional_test[i].cplen ||
ret > datalen) {
Received on Thu Nov 24 2022 - 15:00:49 CET
This archive was generated by hypermail 2.3.0
: Thu Nov 24 2022 - 15:12:31 CET