aboutsummaryrefslogtreecommitdiff
path: root/tests/jittertest/Makemodule.am
diff options
context:
space:
mode:
authorAviv Daum <aviv.daum@gmail.com>2026-03-19 00:53:32 +0200
committerDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2026-04-13 08:42:56 +0200
commit514063a6d7a628e358894b6a6a6cb089c264fc09 (patch)
treed817461ddd1133a03e08a6bd555c5b6356f1f000 /tests/jittertest/Makemodule.am
parent5f7dd327a813c83f97f4a6128bb82c021ed870d8 (diff)
mtd-utils: tests: jittertest: reject overlong file names
plotJittervsFill copies the -f argument into a 250-byte buffer with strncpy(..., sizeof(LogFile)). A 250-byte file name leaves the buffer unterminated, and the subsequent fopen() reads past the end of LogFile. JitterTest uses the same fixed-size file name pattern for -r, while -c still silently truncates overlong names and -f already rejects them. Validate jittertest file name arguments before copying them so these options all reject overlong input instead of truncating it or reading past the end of fixed-size buffers. Add a shell regression test that exercises the accepted and rejected boundary lengths for plotJittervsFill and JitterTest during make check. Signed-off-by: Aviv Daum <aviv.daum@gmail.com> Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
Diffstat (limited to 'tests/jittertest/Makemodule.am')
-rw-r--r--tests/jittertest/Makemodule.am6
1 files changed, 4 insertions, 2 deletions
diff --git a/tests/jittertest/Makemodule.am b/tests/jittertest/Makemodule.am
index d280192..2cb85c1 100644
--- a/tests/jittertest/Makemodule.am
+++ b/tests/jittertest/Makemodule.am
@@ -6,6 +6,8 @@ plotJittervsFill_CPPFLAGS = $(AM_CPPFLAGS)
test_PROGRAMS += JitterTest plotJittervsFill
-test_SCRIPTS += tests/jittertest/filljffs2.sh
+test_SCRIPTS += tests/jittertest/filljffs2.sh tests/jittertest/filename_bounds.sh
+TESTS += tests/jittertest/filename_bounds.sh
-EXTRA_DIST += tests/jittertest/README tests/jittertest/filljffs2.sh
+EXTRA_DIST += tests/jittertest/README tests/jittertest/filljffs2.sh \
+ tests/jittertest/filename_bounds.sh.in