Client crashes in gnutls psk setup

src/coap_gnutls.c:

Correct typo when null terminating username.
This commit is contained in:
Jon Shallow committed 2019-03-31 20:33:46 +01:00
1 parent 0158bc46fa
commit d6562e8b59
1 file changed
+1 -1
+1 -1
View File
@@ -404,7 +404,7 @@ psk_client_callback(gnutls_session_t g_session,
*username = gnutls_malloc(identity_len+1);
if (*username) {
memcpy(*username, identity, identity_len);
*username[identity_len] = '\0';
username[identity_len] = '\0';
}
key->data = gnutls_malloc(psk_len);