From: Willy Tarreau Date: Mon, 28 Apr 2025 14:35:24 +0000 (+0200) Subject: BUILD: acme: use my_strndup() instead of strndup() X-Git-Tag: v3.2-dev13~70 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=589d916efa2bf523db9e890eb9a6d0d9faee7e10;p=thirdparty%2Fhaproxy.git BUILD: acme: use my_strndup() instead of strndup() Not all systems have strndup(), that's why we have our "my_strndup()", so let's make use of it here. This fixes the build on Solaris 10. No backport is needed. --- diff --git a/src/acme.c b/src/acme.c index 1cca2b74f..8303458be 100644 --- a/src/acme.c +++ b/src/acme.c @@ -446,7 +446,7 @@ static int cfg_postsection_acme() trash.data = jws_thumbprint(cur_acme->account.pkey, trash.area, trash.size); - cur_acme->account.thumbprint = strndup(trash.area, trash.data); + cur_acme->account.thumbprint = my_strndup(trash.area, trash.data); if (!cur_acme->account.thumbprint) { ha_alert("acme: out of memory.\n"); err_code |= ERR_ALERT | ERR_FATAL | ERR_ABORT; @@ -1887,7 +1887,7 @@ X509_REQ *acme_x509_req(EVP_PKEY *pkey, char **san) for (i = 0; san[i]; i++) { chunk_appendf(san_trash, "%sDNS:%s", i ? "," : "", san[i]); } - str_san = strndup(san_trash->area, san_trash->data); + str_san = my_strndup(san_trash->area, san_trash->data); if ((ext_san = X509V3_EXT_conf_nid(NULL, NULL, NID_subject_alt_name, str_san)) == NULL) goto error;