Skip to content

armgit / godot

Public Imported from GitHub
0

Godot Engine – Multi-platform 2D and 3D game engine

Fix invalid character in X509Certificate.save_to_string()

Luciano Leão02b3eced8d56
diff --git a/modules/mbedtls/crypto_mbedtls.cpp b/modules/mbedtls/crypto_mbedtls.cpp
index ee3e6231b8b..7d819b136c3 100644
--- a/modules/mbedtls/crypto_mbedtls.cpp
+++ b/modules/mbedtls/crypto_mbedtls.cpp
@@ -308,7 +308,7 @@ String X509CertificateMbedTLS::save_to_string() {
ERR_FAIL_COND_V_MSG(ret != 0 || wrote == 0, String(), "Error saving the certificate.");
// PEM is base64, aka ascii
- buffer += String::ascii(Span((char *)w, wrote));
+ buffer += String::ascii(Span((char *)w, wrote - 1));
crt = crt->next;
}
if (buffer.length() <= PEM_MIN_SIZE) {