Skip to content

Commit d11400f

Browse files
authored
test: avoid UB in test17 (#312)
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.
1 parent d01cd71 commit d11400f

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

testdata/testinput17

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -304,7 +304,7 @@
304304
/[aCz]/mg,firstline,newline=lf
305305
match\nmatch
306306

307-
//jitfast
307+
//jit
308308
\=null_subject
309309

310310
# End of testinput17

testdata/testoutput17

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -550,7 +550,7 @@ Failed: error -47: match limit exceeded
550550
match\nmatch
551551
0: a (JIT)
552552

553-
//jitfast
553+
//jit
554554
\=null_subject
555555
0: (JIT)
556556

0 commit comments

Comments
 (0)