X-Git-Url: https://git.exim.org/exim.git/blobdiff_plain/22ed7a5295f196fce32563f6e9c669110dd36f4d..4191cb150300d310ab5fa22ce2cfb02b6f6051b0:/src/src/regex.c diff --git a/src/src/regex.c b/src/src/regex.c index 35af5e1b5..c1acf4c6e 100644 --- a/src/src/regex.c +++ b/src/src/regex.c @@ -4,7 +4,7 @@ /* Copyright (c) Tom Kistner 2003-2015 * License: GPL - * Copyright (c) The Exim Maintainers 2016 - 2018 + * Copyright (c) The Exim Maintainers 2016 - 2021 */ /* Code for matching regular expressions against headers and body. @@ -50,12 +50,12 @@ while ((regex_string = string_nextinlist(&list, &sep, NULL, 0))) uschar errbuf[128]; pcre2_get_error_message(err, errbuf, sizeof(errbuf)); log_write(0, LOG_MAIN, - "regex acl condition warning - error in regex '%s': %s at offset %l, skipped.", + "regex acl condition warning - error in regex '%s': %s at offset %ld, skipped.", regex_string, errbuf, (long)pcre_erroffset); continue; } - ri = store_get(sizeof(pcre_list), FALSE); + ri = store_get(sizeof(pcre_list), GET_UNTAINTED); ri->re = re; ri->pcre_text = regex_string; ri->next = re_list_head; @@ -85,7 +85,7 @@ for (pcre_list * ri = re_list_head; ri; ri = ri->next) PCRE2_UCHAR * cstr; PCRE2_SIZE cslen; pcre2_substring_get_bynumber(md, nn, &cstr, &cslen); - regex_vars[nn-1] = US cstr; + regex_vars[nn-1] = CUS cstr; } return OK; @@ -133,7 +133,7 @@ if (!(re_list_head = compile(*listptr))) return FAIL; /* no regexes -> nothing to do */ /* match each line against all regexes */ -linebuffer = store_get(32767, TRUE); /* tainted */ +linebuffer = store_get(32767, GET_TAINTED); while (fgets(CS linebuffer, 32767, mbox_file)) { if ( mime_stream && mime_current_boundary /* check boundary */ @@ -204,7 +204,7 @@ if (!(f = fopen(CS mime_decoded_filename, "rb"))) } /* get 32k memory, tainted */ -mime_subject = store_get(32767, TRUE); +mime_subject = store_get(32767, GET_TAINTED); mime_subject_len = fread(mime_subject, 1, 32766, f);