[riot-notifications] [RIOT-OS/RIOT] sock/async: add function to retrieve session object of current DTLS event (#15755)

János Brodbeck notifications at github.com
Thu Jan 14 01:33:56 CET 2021


@janosbrodbeck commented on this pull request.



> @@ -87,6 +87,7 @@ static int _read(struct dtls_context_t *ctx, session_t *session, uint8_t *buf,
     sock->buffer.session = session;
 #ifdef SOCK_HAS_ASYNC
     if (sock->async_cb != NULL) {
+        memcpy(&sock->async_cb_session, session, sizeof(session_t));

Ahh was wondering too when this gets called.
The problem I saw with not setting it to NULL is that it points to "random" memory and could potentially be misused?

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/RIOT-OS/RIOT/pull/15755#discussion_r556967383
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20210113/5f60628b/attachment.htm>


More information about the notifications mailing list