From ba6a7526c938590539ab2c2137521565a1f9621b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlo=20Marcelo=20Arenas=20Bel=C3=B3n?= Date: Sat, 21 Oct 2023 18:22:30 -0700 Subject: [PATCH] test: avoid UB in test17 Since 4ef0c51 (Interpret NULL pointer, zero length as an empty string for subjects and replacements., 2021-11-30), a NULL pointer with zero length has been internally replaced with an empty string in all matching functions, but the test for jit was incorrectly using the fastpath which intentionally skips all validation and results in NULL pointer arithmetic operations. Change the test to use the validating jit path instead. --- testdata/testinput17 | 2 +- testdata/testoutput17 | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/testdata/testinput17 b/testdata/testinput17 index caf4c91ae..9c62c3916 100644 --- a/testdata/testinput17 +++ b/testdata/testinput17 @@ -304,7 +304,7 @@ /[aCz]/mg,firstline,newline=lf match\nmatch -//jitfast +//jit \=null_subject # End of testinput17 diff --git a/testdata/testoutput17 b/testdata/testoutput17 index b5b2cc8a1..5d68b0a47 100644 --- a/testdata/testoutput17 +++ b/testdata/testoutput17 @@ -550,7 +550,7 @@ Failed: error -47: match limit exceeded match\nmatch 0: a (JIT) -//jitfast +//jit \=null_subject 0: (JIT)