use dynamic mem for regex_match_string
authorJeremy Harris <jgh146exb@wizmail.org>
Sun, 11 Feb 2024 15:04:58 +0000 (15:04 +0000)
committerJeremy Harris <jgh146exb@wizmail.org>
Sun, 11 Feb 2024 15:04:58 +0000 (15:04 +0000)
src/src/regex.c

index bb34e5b23f4ad1a63167c503e6cf87fa6e328ba9..d5dc1025852eda58eff36fe78efed2f98dce7f12 100644 (file)
@@ -24,8 +24,6 @@ typedef struct pcre_list {
   struct pcre_list *   next;
 } pcre_list;
 
-uschar regex_match_string_buffer[1024];
-
 extern FILE *mime_stream;
 extern uschar *mime_current_boundary;
 
@@ -85,9 +83,7 @@ for (pcre_list * ri = re_list_head; ri; ri = ri->next)
     int save_pool = store_pool;
     store_pool = POOL_PERM;
 
-    Ustrncpy(regex_match_string_buffer, ri->pcre_text,
-             sizeof(regex_match_string_buffer)-1);
-    regex_match_string = regex_match_string_buffer;
+    regex_match_string = string_copy(ri->pcre_text);
 
     for (int nn = 1; nn < n; nn++)
       {