From 59108d3f4da48a7b76390b729427c6a80ca52fe2 Mon Sep 17 00:00:00 2001 From: Minos Galanakis Date: Mon, 25 Sep 2023 14:11:22 +0100 Subject: [PATCH] x509_crt: Adjusted the len of lpMultiByteStr arg in WideCharToMultiByte Signed-off-by: Minos Galanakis --- library/x509_crt.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/library/x509_crt.c b/library/x509_crt.c index 162281dfa..4418dab76 100644 --- a/library/x509_crt.c +++ b/library/x509_crt.c @@ -1585,8 +1585,7 @@ int mbedtls_x509_crt_parse_path(mbedtls_x509_crt *chain, const char *path) continue; } w_ret = WideCharToMultiByte(CP_ACP, 0, file_data.cFileName, - -1, p, (int) len - 1, - NULL, NULL); + -1, p, (int) len, NULL, NULL); if (w_ret == 0) { ret = MBEDTLS_ERR_X509_FILE_IO_ERROR; goto cleanup;