summaryrefslogtreecommitdiff
path: root/lib/x509/common.c
diff options
context:
space:
mode:
authorDaiki Ueno <ueno@gnu.org>2021-09-23 07:50:38 +0000
committerDaiki Ueno <ueno@gnu.org>2021-09-23 07:50:38 +0000
commit7a220bf3899f3a32d6ff667d3861d15312ccd35b (patch)
tree131eb151d1185653a4c34ad345872a980420e4c0 /lib/x509/common.c
parent970000abfe3f88a8659da084852db258310246fd (diff)
parenta00a79ddf41eb14d56bdea076b5c252029896431 (diff)
downloadgnutls-7a220bf3899f3a32d6ff667d3861d15312ccd35b.tar.gz
Merge branch 'x25519-and-x448' into 'master'
certtool: generate, parse, and manipulate X25519 and X448 pubkeys, privkeys, and certificates See merge request gnutls/gnutls!1428
Diffstat (limited to 'lib/x509/common.c')
-rw-r--r--lib/x509/common.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/x509/common.c b/lib/x509/common.c
index c156bd96a9..94d206ff75 100644
--- a/lib/x509/common.c
+++ b/lib/x509/common.c
@@ -630,7 +630,8 @@ _gnutls_x509_decode_string(unsigned int etype,
if (td.data == NULL)
return gnutls_assert_val(GNUTLS_E_MEMORY_ERROR);
- memcpy(td.data, str, str_size);
+ if (str_size > 0)
+ memcpy(td.data, str, str_size);
td.data[str_size] = 0;
if (allow_ber)