x509asn1: prevent NULL dereference

Closes #13978
This commit is contained in:
z2_ 2024-06-20 21:57:07 +02:00 committed by Daniel Stenberg
parent df2fbc2777
commit 36e9222c42
No known key found for this signature in database
GPG Key ID: 5CC908FDB71E12C2

View File

@ -695,6 +695,11 @@ static CURLcode encodeDN(struct dynbuf *store, struct Curl_asn1Element *dn)
str = Curl_dyn_ptr(&temp); str = Curl_dyn_ptr(&temp);
if(!str) {
result = CURLE_BAD_FUNCTION_ARGUMENT;
goto error;
}
/* Encode delimiter. /* Encode delimiter.
If attribute has a short uppercase name, delimiter is ", ". */ If attribute has a short uppercase name, delimiter is ", ". */
for(p3 = str; ISUPPER(*p3); p3++) for(p3 = str; ISUPPER(*p3); p3++)