Closed
Description
AFL found a regex pattern where the two engines differ on .is_match(). There are many more examples, I strongly suspect them to be of the same underlying cause, though.
Tested with git as of today. As far as I tested this, the assertion succeeds if the bogus repetition count is removed or set to 1 or if the 'ä' is turned into an ASCII-character.
extern crate regex;
pub const HAYSTACK_BYTES: [u8; 262] = [212,194,101,43,14,254,200,102,172,158,178,63,73,128,238,90,186,218,203,107,17,42,187,194,114,122,39,42,202,120,78,115,51,8,109,230,114,178,50,40,233,196,250,19,230,246,130,68,88,49,4,87,73,253,96,140,121,187,133,37,174,185,69,126,100,39,234,88,147,125,51,142,131,153,103,107,47,27,92,0,36,42,79,245,225,15,205,183,108,44,19,164,215,140,128,87,12,217,253,133,5,251,120,78,224,130,209,100,78,138,101,62,121,226,131,123,19,12,130,77,118,202,115,187,243,168,18,46,102,111,111,98,97,114,89,240,245,241,239,215,176,34,71,253,166,145,32,162,6,23,106,198,192,105,182,19,183,228,153,80,140,62,171,120,184,101,142,165,165,162,123,222,119,97,28,72,30,246,250,12,210,74,180,118,38,99,44,211,198,82,31,131,198,120,65,12,31,76,15,18,137,80,242,118,195,176,244,106,138,176,15,67,203,132,213,138,65,3,242,223,20,137,37,214,96,32,72,109,132,75,28,112,190,249,19,243,98,136,224,12,182,154,248,111,245,31,108,144,25,209,196,192,225,207,145,190,24,2,216,33,127,138,];
fn main() {
let pattern = "${2}ä";
let haystack = &HAYSTACK_BYTES;
let re0 = regex::internal::ExecBuilder::new(pattern).build().map(|b| b.into_byte_regex()).unwrap();
let re1 = regex::internal::ExecBuilder::new(pattern).nfa().build().unwrap().into_byte_regex();
assert_eq!(re0.is_match(haystack), re1.is_match(haystack));
}