* Exim - an Internet mail transport agent *
*************************************************/
-/* Copyright (c) The Exim Maintainers 2020 - 2022 */
+/* Copyright (c) The Exim Maintainers 2020 - 2023 */
/* Copyright (c) University of Cambridge 1995 - 2018 */
/* See the file NOTICE for conditions of use and distribution. */
/* SPDX-License-Identifier: GPL-2.0-or-later */
if (sender_ident)
g = string_fmt_append(g, " U=%s", sender_ident);
}
+if (LOGGING(connection_id))
+ g = string_fmt_append(g, " Ci=%lu", connection_id);
gstring_release_unused(g);
return string_from_gstring(g);
}
*/
int
-host_nmtoa(int count, int *binary, int mask, uschar *buffer, int sep)
+host_nmtoa(int count, const int * binary, int mask, uschar * buffer, int sep)
{
-int j;
-uschar *tt = buffer;
+uschar * tt = buffer;
if (count == 1)
- {
- j = binary[0];
- for (int i = 24; i >= 0; i -= 8)
+ for (int j = binary[0], i = 24; i >= 0; i -= 8)
tt += sprintf(CS tt, "%d.", (j >> i) & 255);
- }
else
- for (int i = 0; i < 4; i++)
+ for (int j, i = 0; i < 4; i++)
{
j = binary[i];
tt += sprintf(CS tt, "%04x%c%04x%c", (j >> 16) & 0xffff, sep, j & 0xffff, sep);
const uschar * s = rr->data; /* MUST be unsigned for GETSHORT */
uschar data[256];
+ if (rr_bad_size(rr, sizeof(uint16_t))) continue;
GETSHORT(precedence, s); /* Pointer s is advanced */
/* For MX records, we use a random "weight" which causes multiple records of
/* SRV records are specified with a port and a weight. The weight is used
in a special algorithm. However, to start with, we just use it to order the
records of equal priority (precedence). */
+
+ if (rr_bad_increment(rr, s, 2 * sizeof(uint16_t))) continue;
GETSHORT(weight, s);
GETSHORT(port, s);
}