git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] t4062: stop using repetition in regex
@ 2017-08-08  6:53 René Scharfe
  2017-08-08 14:49 ` Johannes Schindelin
  0 siblings, 1 reply; 17+ messages in thread
From: René Scharfe @ 2017-08-08  6:53 UTC (permalink / raw)
  To: Git List
  Cc: David Coppa, Johannes Schindelin, Junio C Hamano,
	SZEDER Gábor

OpenBSD's regex library has a repetition limit (RE_DUP_MAX) of 255.
That's the minimum acceptable value according to POSIX.  In t4062 we use
4096 repetitions in the test "-G matches", though, causing it to fail.

Do the same as the test "-S --pickaxe-regex" in the same file and search
for a single zero instead.  That still suffices to trigger the buffer
overrun in older versions (checked with b7d36ffca02^ and --valgrind on
Linux), simplifies the test a bit, and avoids exceeding OpenBSD's limit.

Original-patch-by: David Coppa <dcoppa@openbsd.org>
Signed-off-by: Rene Scharfe <l.s.r@web.de>
---
 t/t4062-diff-pickaxe.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/t/t4062-diff-pickaxe.sh b/t/t4062-diff-pickaxe.sh
index 7c4903f497..c16e5af6fa 100755
--- a/t/t4062-diff-pickaxe.sh
+++ b/t/t4062-diff-pickaxe.sh
@@ -15,7 +15,7 @@ test_expect_success setup '
 	git commit -m "A 4k file"
 '
 test_expect_success '-G matches' '
-	git diff --name-only -G "^0{4096}$" HEAD^ >out &&
+	git diff --name-only -G0 HEAD^ >out &&
 	test 4096-zeroes.txt = "$(cat out)"
 '
 
-- 
2.14.0

^ permalink raw reply related	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2017-08-11 18:21 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-08-08  6:53 [PATCH] t4062: stop using repetition in regex René Scharfe
2017-08-08 14:49 ` Johannes Schindelin
2017-08-08 15:18   ` René Scharfe
2017-08-08 22:09     ` Junio C Hamano
2017-08-08 22:26       ` Junio C Hamano
2017-08-08 22:34         ` René Scharfe
2017-08-09  5:29           ` Junio C Hamano
2017-08-09  6:15             ` René Scharfe
2017-08-09 14:15               ` René Scharfe
2017-08-09 14:25                 ` David Coppa
2017-08-09 21:49                   ` Johannes Schindelin
2017-08-09 16:07                 ` Junio C Hamano
2017-08-09 17:20                   ` René Scharfe
2017-08-09 17:47                     ` Junio C Hamano
2017-08-10  6:08                       ` René Scharfe
2017-08-11 18:20                         ` Junio C Hamano
2017-08-08 22:27       ` René Scharfe

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).