Do not falsely read entire buffer instead of simply the filled with - libgraphe… | |
git clone git://git.suckless.org/libgrapheme | |
Log | |
Files | |
Refs | |
README | |
LICENSE | |
--- | |
commit b9e1d4bbd4ce6a539999560c1cc863b645a080cd | |
parent 0d043e0a0cd062ea09d8238b33a97049fea9bc8b | |
Author: Laslo Hunhold <[email protected]> | |
Date: Thu, 24 Nov 2022 13:29:31 +0100 | |
Do not falsely read entire buffer instead of simply the filled with | |
This was caught via dynamic 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 <[email protected]> | |
Diffstat: | |
M test/bidirectional.c | 2 +- | |
1 file changed, 1 insertion(+), 1 deletion(-) | |
--- | |
diff --git a/test/bidirectional.c b/test/bidirectional.c | |
@@ -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) { |