[exim-cvs] Use non-releasable memory for regex line-buffer

Αρχική Σελίδα
Delete this message
Reply to this message
Συντάκτης: Exim Git Commits Mailing List
Ημερομηνία:  
Προς: exim-cvs
Αντικείμενο: [exim-cvs] Use non-releasable memory for regex line-buffer
Gitweb: https://git.exim.org/exim.git/commitdiff/a173a4376d168edbf3fe2494dff998c4060bf425
Commit:     a173a4376d168edbf3fe2494dff998c4060bf425
Parent:     6fcb3173d64ef8a9d70f8adf19f134a0cd9cf6e8
Author:     Jeremy Harris <jgh146exb@???>
AuthorDate: Tue Feb 13 17:34:19 2024 +0000
Committer:  Jeremy Harris <jgh146exb@???>
CommitDate: Tue Feb 13 17:34:19 2024 +0000


    Use non-releasable memory for regex line-buffer


    Broken-by: 5aacb69f5c8
---
 src/src/regex.c | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)


diff --git a/src/src/regex.c b/src/src/regex.c
index d5dc10258..642b9cf93 100644
--- a/src/src/regex.c
+++ b/src/src/regex.c
@@ -118,7 +118,6 @@ regex(const uschar ** listptr, BOOL cacheable)
 unsigned long mbox_size;
 FILE * mbox_file;
 pcre_list * re_list_head;
-uschar * linebuffer;
 long f_pos = 0;
 int ret = FAIL, cnt, lcount = REGEX_LOOPCOUNT_STORE_RESET;
 rmark reset_point;
@@ -151,16 +150,15 @@ reset_point = store_mark();
   if ((re_list_head = compile(*listptr, cacheable, &cnt)))
     {
     /* match each line against all regexes */
-    linebuffer = store_get(32767, GET_TAINTED);
-    while (fgets(CS linebuffer, 32767, mbox_file))
+    while (fgets(CS big_buffer, big_buffer_size, mbox_file))
       {
       if (  mime_stream && mime_current_boundary        /* check boundary */
-     && Ustrncmp(linebuffer, "--", 2) == 0
-     && Ustrncmp((linebuffer+2), mime_current_boundary,
+     && Ustrncmp(big_buffer, "--", 2) == 0
+     && Ustrncmp((big_buffer+2), mime_current_boundary,
               Ustrlen(mime_current_boundary)) == 0)
     break;                        /* found boundary */


-      if ((ret = matcher(re_list_head, linebuffer, (int)Ustrlen(linebuffer))) == OK)
+      if ((ret = matcher(re_list_head, big_buffer, (int)Ustrlen(big_buffer))) == OK)
     break;


       if ((lcount -= cnt) <= 0)


--
## subscription configuration (requires account):
## https://lists.exim.org/mailman3/postorius/lists/exim-cvs.lists.exim.org/
## unsubscribe (doesn't require an account):
## exim-cvs-unsubscribe@???
## Exim details at http://www.exim.org/
## Please use the Wiki with this list - http://wiki.exim.org/