Commit 2f3b27d9 authored by Carsten Schoenert's avatar Carsten Schoenert

rebuild patch queue from patch-queue branch

added patches:
Client-crashes-in-gnutls-psk-setup.patc
Fix-321-was-not-correctly-implemented.patch

The patches are cherry-picked directly from the upstream tree.
https://github.com/obgm/libcoap/commit/d6562e8b5923b0a08cfecebe9abc341f9fede63f
https://github.com/obgm/libcoap/commit/a106ecc319f4c6427ee0fce5cec90d86a9cc7987
parent 3d843fbf
From: Jon Shallow <supjps-libcoap@jpshallow.com>
Date: Sun, 31 Mar 2019 20:33:46 +0100
Subject: Client crashes in gnutls psk setup
src/coap_gnutls.c:
Correct typo when null terminating username.
---
src/coap_gnutls.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/coap_gnutls.c b/src/coap_gnutls.c
index 026f378..08f3099 100644
--- a/src/coap_gnutls.c
+++ b/src/coap_gnutls.c
@@ -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);
From: Jon Shallow <supjps-libcoap@jpshallow.com>
Date: Sun, 7 Apr 2019 17:48:46 +0100
Subject: 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.
---
src/coap_gnutls.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/coap_gnutls.c b/src/coap_gnutls.c
index 08f3099..cbfdffb 100644
--- a/src/coap_gnutls.c
+++ b/src/coap_gnutls.c
@@ -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);
examples-Makefile.am-remove-DTLS_LIBS-variable.patch
examples-Makefile.am-create-DTLS-specific-binary-names.patch
Client-crashes-in-gnutls-psk-setup.patch
Fix-321-was-not-correctly-implemented.patch
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment