commit 3d6890e58caf999f4c83932d27ddf5ec673cf014 Author: Jacob Welsh AuthorDate: Tue Oct 28 21:23:40 2025 +0000 Commit: Jacob Welsh CommitDate: Tue Oct 28 21:23:40 2025 +0000 busybox/testsuite: add tests for grep context buffer leak for which the prior attempted fix caused data loss at 2^31 input lines. These successfully demonstrate that the original bug was real, that a first attempt of just switching to uint64_t leaves things broken in yet another way, and that the current stronger approach of clearing the buffer on each new file resolves it for all those known cases. diff --git a/base/busybox/testsuite/grep.tests b/base/busybox/testsuite/grep.tests index f6d9f21..7a63c5c 100755 --- a/base/busybox/testsuite/grep.tests +++ b/base/busybox/testsuite/grep.tests @@ -191,6 +191,40 @@ testing "grep -r on dir/symlink to dir" \ "" "" rm -Rf grep.testdir +optional FEATURE_GREP_CONTEXT +mkdir -p grep.testdir +cat >grep.testdir/a <grep.testdir/b <