1
0
Fork 0
mirror of https://github.com/warmcat/libwebsockets.git synced 2025-03-09 00:00:04 +01:00

pem_to_der: fix binary mode length handling

This commit is contained in:
Andy Green 2019-09-16 18:18:17 +01:00
parent b65b8f4c6f
commit 10315893f7

View file

@ -214,8 +214,8 @@ lws_tls_alloc_pem_to_der_file(struct lws_context *context, const char *filename,
if (filename)
*q = '\0';
*amount = lws_b64_decode_string((char *)p, (char *)pem,
(int)(long long)len);
*amount = lws_b64_decode_string_len((char *)p, lws_ptr_diff(q, p),
(char *)pem, (int)(long long)len);
*buf = (uint8_t *)pem;
return 0;