mirror of
https://github.com/obgm/libcoap.git
synced 2026-11-04 08:55:40 +03:00
Fix #321 was not correctly implemented
While #321 prevented a core dump, that fix still caused memory corruption. src/coap_gnutls.c: Correct the code to correctly NULL terminate the created username.
This commit is contained in:
1 parent
af1d602486
commit
a106ecc319
1 file changed
+1
-1
+1
-1
@@ -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);
|
||||
|
||||
Reference in new issue
Block a user