Unified · Split
| @@ -216,11 +216,13 @@ int ff_ssl_read_key_cert(char *key_url, char *cert_url, char *key_buf, size_t ke · 215 unmodified lines | |||
| 216 | snprintf(cert_buf, cert_sz, "%s", cert_tem); | 216 | snprintf(cert_buf, cert_sz, "%s", cert_tem); |
| 217 | 217 | ||
| 218 | /* Generate fingerprint. */ | 218 | /* Generate fingerprint. */ |
| 219 | *fingerprint = generate_fingerprint(cert); | 219 | if (fingerprint) { |
| 220 | if (!*fingerprint) { | 220 | *fingerprint = generate_fingerprint(cert); |
| 221 | av_log(NULL, AV_LOG_ERROR, "TLS: Failed to generate fingerprint from %s\n", cert_url); | 221 | if (!*fingerprint) { |
| 222 | ret = AVERROR(EIO); | 222 | av_log(NULL, AV_LOG_ERROR, "TLS: Failed to generate fingerprint from %s\n", cert_url); |
| 223 | goto end; | 223 | ret = AVERROR(EIO); |
| 224 | goto end; | ||
| 225 | } | ||
| 224 | } | 226 | } |
| 225 | 227 | ||
| 226 | end: | 228 | end: |
| @@ -371,9 +373,11 @@ static int openssl_gen_certificate(EVP_PKEY *pkey, X509 **cert, char **fingerpri · 144 unmodified lines | |||
| 371 | goto einval_end; | 373 | goto einval_end; |
| 372 | } | 374 | } |
| 373 | 375 | ||
| 374 | *fingerprint = generate_fingerprint(*cert); | 376 | if (fingerprint) { |
| 375 | if (!*fingerprint) { | 377 | *fingerprint = generate_fingerprint(*cert); |
| 376 | goto enomem_end; | 378 | if (!*fingerprint) { |
| 379 | goto enomem_end; | ||
| 380 | } | ||
| 377 | } | 381 | } |
| 378 | 382 | ||
| 379 | goto end; | 383 | goto end; |