Harden dnsdb against crafted DNS responses. Bug 3033
[exim.git] / src / src / lookups / dsearch.c
index 2cf880ddae9758fa425a918e7b3cb4ea97ddae11..a7691024ad5aaa06d62ba843701d001e4b6187b1 100644 (file)
@@ -2,8 +2,8 @@
 *     Exim - an Internet mail transport agent    *
 *************************************************/
 
+/* Copyright (c) The Exim Maintainers 2020 - 2022 */
 /* Copyright (c) University of Cambridge 1995 - 2015 */
-/* Copyright (c) The Exim Maintainers 2020 - 2021 */
 /* See the file NOTICE for conditions of use and distribution. */
 
 /* The idea for this code came from Matthew Byng-Maddick, but his original has
@@ -124,7 +124,7 @@ if (  Ulstat(filename, &statbuf) >= 0
   {
   /* Since the filename exists in the filesystem, we can return a
   non-tainted result. */
-  *result = string_copy_taint(flags & RET_FULL ? filename : keystring, FALSE);
+  *result = string_copy_taint(flags & RET_FULL ? filename : keystring, GET_UNTAINTED);
   return OK;
   }
 
@@ -158,12 +158,13 @@ handle = handle;   /* Avoid compiler warning */
 
 #include "../version.h"
 
-void
-dsearch_version_report(FILE *f)
+gstring *
+dsearch_version_report(gstring * g)
 {
 #ifdef DYNLOOKUP
-fprintf(f, "Library version: dsearch: Exim version %s\n", EXIM_VERSION_STR);
+g = string_fmt_append(g, "Library version: dsearch: Exim version %s\n", EXIM_VERSION_STR);
 #endif
+return g;
 }