mirror of
https://github.com/tbnobody/OpenDTU.git
synced 2025-12-16 23:31:04 +01:00
Replace sprintf by snprintf
This commit is contained in:
@@ -278,7 +278,7 @@ String WebApiMqttClass::getRootCaCertInfo(const char* cert)
|
||||
mbedtls_x509_crt_init(&global_cacert);
|
||||
int ret = mbedtls_x509_crt_parse(&global_cacert, const_cast<unsigned char*>((unsigned char*)cert), 1 + strlen(cert));
|
||||
if (ret < 0) {
|
||||
sprintf(rootCaCertInfo, "Can't parse root ca: mbedtls_x509_crt_parse returned -0x%x\n\n", -ret);
|
||||
snprintf(rootCaCertInfo, sizeof(rootCaCertInfo), "Can't parse root ca: mbedtls_x509_crt_parse returned -0x%x\n\n", -ret);
|
||||
mbedtls_x509_crt_free(&global_cacert);
|
||||
return "";
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user