From: z2_ <88509734+z2-2z@users.noreply.github.com> Date: Thu, 20 Jun 2024 19:57:07 +0000 (+0200) Subject: x509asn1: prevent NULL dereference X-Git-Tag: curl-8_9_0~215 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=36e9222c42ff74a71ea4e52150285e2264ad4dd0;p=thirdparty%2Fcurl.git x509asn1: prevent NULL dereference Closes #13978 --- diff --git a/lib/vtls/x509asn1.c b/lib/vtls/x509asn1.c index c896838de7..f71ab0b90a 100644 --- a/lib/vtls/x509asn1.c +++ b/lib/vtls/x509asn1.c @@ -695,6 +695,11 @@ static CURLcode encodeDN(struct dynbuf *store, struct Curl_asn1Element *dn) str = Curl_dyn_ptr(&temp); + if(!str) { + result = CURLE_BAD_FUNCTION_ARGUMENT; + goto error; + } + /* Encode delimiter. If attribute has a short uppercase name, delimiter is ", ". */ for(p3 = str; ISUPPER(*p3); p3++)