wolfssl: proof use of wolfSSL_i2d_SSL_SESSION
No binary (build failed)
—
(log yok)
| @@ -425,7 +425,7 @@ CURLcode Curl_wssl_cache_session(struct Curl_cfilter *cf, | |
| { | |
| CURLcode result = CURLE_OK; | |
| struct Curl_ssl_session *sc_session = NULL; | |
| - | unsigned char *sdata = NULL, *qtp_clone = NULL; |
| + | unsigned char *sdata = NULL, *sdata_ptr, *qtp_clone = NULL; |
| unsigned int sdata_len; | |
| unsigned int earlydata_max = 0; | |
| @@ -438,13 +438,15 @@ CURLcode Curl_wssl_cache_session(struct Curl_cfilter *cf, | |
| result = CURLE_FAILED_INIT; | |
| goto out; | |
| } | |
| - | sdata = curlx_calloc(1, sdata_len); |
| + | sdata = sdata_ptr = curlx_calloc(1, sdata_len); |
| if(!sdata) { | |
| failf(data, "unable to allocate session buffer of %u bytes", sdata_len); | |
| result = CURLE_OUT_OF_MEMORY; | |
| goto out; | |
| } | |
| - | sdata_len = wolfSSL_i2d_SSL_SESSION(session, &sdata); |
| + | /* wolfSSL right now does not change the last parameter here, but it |
| + | * might one day decide to do so for OpenSSL compatibility. */ |
| + | sdata_len = wolfSSL_i2d_SSL_SESSION(session, &sdata_ptr); |
| if(sdata_len <= 0) { | |
| CURL_TRC_CF(data, cf, "fail to serialize session: %u", sdata_len); | |
| result = CURLE_FAILED_INIT; | |