File tree Expand file tree Collapse file tree 3 files changed +14
-0
lines changed
Expand file tree Collapse file tree 3 files changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -852,6 +852,8 @@ else if (use_existing_match)
852852 + 2 * pairs * sizeof (PCRE2_SIZE ));
853853 internal_match_data -> heapframes = NULL ;
854854 internal_match_data -> heapframes_size = 0 ;
855+ /* Ensure that the subject is not freed when internal_match_data is */
856+ internal_match_data -> flags &= ~PCRE2_MD_COPIED_SUBJECT ;
855857 match_data = internal_match_data ;
856858 }
857859
Original file line number Diff line number Diff line change @@ -8108,4 +8108,9 @@ a)"xI
81088108/x/replace=r,substitute_matched
81098109 x\=null_subject
81108110
8111+ # Test that a couple of double frees have been fixed
8112+ /foo/replace=bar,substitute_matched
8113+ foo\=copy_matched_subject
8114+ foo\=global,copy_matched_subject
8115+
81118116# End of testinput2
Original file line number Diff line number Diff line change @@ -23234,6 +23234,13 @@ Failed: error 217 at offset 27: expected capture group number or name
2323423234 x\=null_subject
2323523235Failed: error -51: NULL argument passed with non-zero length
2323623236
23237+ # Test that a couple of double frees have been fixed
23238+ /foo/replace=bar,substitute_matched
23239+ foo\=copy_matched_subject
23240+ 1: bar
23241+ foo\=global,copy_matched_subject
23242+ 1: bar
23243+
2323723244# End of testinput2
2323823245Error -80: PCRE2_ERROR_BADDATA (unknown error number)
2323923246Error -62: bad serialized data
You can’t perform that action at this time.
0 commit comments