function is unnecessary and discouraged on GnuTLS 3.6.0 or later. Since
3.6.0, DH parameters are negotiated following RFC7919."
function is unnecessary and discouraged on GnuTLS 3.6.0 or later. Since
3.6.0, DH parameters are negotiated following RFC7919."
+JH/43 Bug 2465: Fix taint-handling in dsearch lookup. Previously a nontainted
+ buffer was used for the filename, resulting in a trap when tainted
+ arguments (eg. $domain) were used.
+
Exim version 4.92
-----------------
Exim version 4.92
-----------------
scanning the directory, as it is hopefully faster to let the OS do the scanning
for us. */
scanning the directory, as it is hopefully faster to let the OS do the scanning
for us. */
-int
-static dsearch_find(void *handle, uschar *dirname, const uschar *keystring, int length,
+static int
+dsearch_find(void *handle, uschar *dirname, const uschar *keystring, int length,
uschar **result, uschar **errmsg, uint *do_cache)
{
struct stat statbuf;
int save_errno;
uschar **result, uschar **errmsg, uint *do_cache)
{
struct stat statbuf;
int save_errno;
-uschar filename[PATH_MAX];
handle = handle; /* Keep picky compilers happy */
length = length;
handle = handle; /* Keep picky compilers happy */
length = length;
-if (!string_format(filename, sizeof(filename), "%s/%s", dirname, keystring))
- {
- *errmsg = US"path name too long";
- return DEFER;
- }
-
+filename = string_sprintf("%s/%s", dirname, keystring);
if (Ulstat(filename, &statbuf) >= 0)
{
*result = string_copy(keystring);
if (Ulstat(filename, &statbuf) >= 0)
{
*result = string_copy(keystring);
*************************************************/
/* The formatting is done by string_vformat, which checks the length of
*************************************************/
/* The formatting is done by string_vformat, which checks the length of
+everything. Taint is taken from the worst of the arguments.
Arguments:
format a printf() format - deliberately char * rather than uschar *
Arguments:
format a printf() format - deliberately char * rather than uschar *