commit 801e13dfab0e60304cf2cd5935da0ea1e2e4811f from: Kirill A. Korinsky date: Fri Jan 31 23:33:54 2025 UTC prevent dkim_ar_cat from lose last character It losed the last character when the length resulted string was multiple of 256 commit - 09d27b584459ff5b29ddecd8754f114edd870b69 commit + 801e13dfab0e60304cf2cd5935da0ea1e2e4811f blob - 9c85ba5bd52795c50f96e7302abd4d33ccbf5d5c blob + 24fa6b361beeed3ee51ed7efb55514422a3d965c --- main.c +++ main.c @@ -1740,7 +1740,7 @@ dkim_ar_cat(char **ar, size_t *n, size_t aroff, const va_end(ap); if (size <= 0) return -1; - if (size + aroff <= *n) + if (size + aroff < *n) return (ssize_t)size + aroff; nn = (((aroff + size) / 256) + 1) * 256; artmp = realloc(*ar, nn);