commit - 540788daa8eabb22c65e8e6d0a5b1b59af6fc545
commit + e1300062dc25b4ed3e083c8d35cce75c2919eb00
blob - 0661d3691fd71b78893aa4ff776e994568fec931
blob + 7063e70409ac3b0a7369ddb3ae7aeb8ab2590b15
--- main.c
+++ main.c
{
domain = reallocarray(domain, ndomains + 1, sizeof(*domain));
if (domain == NULL)
- osmtpd_err(1, "%s: reallocarray", __func__);
+ osmtpd_err(1, "reallocarray");
domain[ndomains++] = d;
}
if (line[0] == '.')
line++;
if ((linedup = strdup(line)) == NULL)
- osmtpd_err(1, "%s: strdup", __func__);
+ osmtpd_err(1, "strdup");
dkim_parse_header(message, linedup, 0);
free(linedup);
} else if (linelen == 0 && message->parsing_headers) {
if (line[0] == '.')
line++;
if ((linedup = strdup(line)) == NULL)
- osmtpd_err(1, "%s: strdup", __func__);
+ osmtpd_err(1, "strdup");
dkim_parse_body(message, linedup);
free(linedup);
}
struct dkim_message *message;
if ((message = calloc(1, sizeof(*message))) == NULL) {
- osmtpd_err(1, "%s: calloc", __func__);
+ osmtpd_err(1, "calloc");
return NULL;
}
message->body_whitelines = 0;
message->headers = calloc(1, sizeof(*(message->headers)));
if (message->headers == NULL)
- osmtpd_err(1, "%s: calloc", __func__);
+ osmtpd_err(1, "calloc");
message->lastheader = 0;
message->signature.signature = NULL;
message->signature.size = 0;
if ((sign_headers = reallocarray(NULL, nsign_headers + 1,
sizeof(*sign_headers))) == NULL)
- osmtpd_errx(1, "%s: reallocarray", __func__);
+ osmtpd_errx(1, "reallocarray");
for (i = 0; i < nsign_headers; i++) {
sign_headers[i] = headers;
mtmp = recallocarray(message->headers, lastheader + 1,
lastheader + 2, sizeof(*mtmp));
if (mtmp == NULL)
- osmtpd_err(1, "%s: reallocarray", __func__);
+ osmtpd_err(1, "reallocarray");
message->headers = mtmp;
if ((message->headers[lastheader] = strdup(line)) == NULL)
- osmtpd_err(1, "%s: strdup", __func__);
+ osmtpd_err(1, "strdup");
message->headers[lastheader + 1 ] = NULL;
message->lastheader = 1;
} else {
htmp = reallocarray(message->headers[lastheader], linelen,
sizeof(*htmp));
if (htmp == NULL)
- osmtpd_err(1, "%s: reallocarray", __func__);
+ osmtpd_err(1, "reallocarray");
message->headers[lastheader] = htmp;
if (canonheader == CANON_SIMPLE) {
if (strlcat(htmp, "\r\n", linelen) >= linelen)
dkim_signature_printf(message, "; d=%s; b=", sdomain);
dkim_signature_normalize(message);
if ((tmp = strdup(message->signature.signature)) == NULL)
- osmtpd_err(1, "%s: strdup", __func__);
+ osmtpd_err(1, "strdup");
dkim_parse_header(message, tmp, 1);
if (!sephash) {
if (EVP_DigestSignUpdate(message->dctx, tmp,
#endif
}
if ((tmp = malloc(linelen)) == NULL)
- osmtpd_err(1, "%s: malloc", __func__);
+ osmtpd_err(1, "malloc");
if (!sephash) {
if (EVP_DigestSignFinal(message->dctx, tmp, &linelen) != 1)
osmtpd_errx(1, "EVP_DigestSignFinal");
#endif
}
if ((b = malloc((((linelen + 2) / 3) * 4) + 1)) == NULL)
- osmtpd_err(1, "%s: malloc", __func__);
+ osmtpd_err(1, "malloc");
EVP_EncodeBlock(b, tmp, linelen);
free(tmp);
dkim_signature_printf(message, "%s\r\n", b);
return;
sig->size = (((len + sig->len) / 512) + 1) * 512;
if ((tmp = realloc(sig->signature, sig->size)) == NULL)
- osmtpd_err(1, "%s: malloc", __func__);
+ osmtpd_err(1, "malloc");
sig->signature = tmp;
}