Skip to content

Commit

Permalink
x
Browse files Browse the repository at this point in the history
  • Loading branch information
rschu1ze committed Jun 18, 2024
1 parent 67c0b63 commit eb20016
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion ssl/ssl_sess.c
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,15 @@ SSL_SESSION *ssl_session_dup(const SSL_SESSION *src, int ticket)
dest = OPENSSL_malloc(sizeof(*dest));
if (dest == NULL)
return NULL;
memcpy(dest, src, sizeof(*dest));

/*
* Copy until prev ptr, because it's a part of sessons cache which can be modified
* concurrently. Other fields filled in the code bellow.
*/
memcpy(dest, src, offsetof(SSL_SESSION, prev));
dest->ext = src->ext;
dest->ticket_appdata_len = src->ticket_appdata_len;
dest->flags = src->flags;

/*
* Set the various pointers to NULL so that we can call SSL_SESSION_free in
Expand Down

0 comments on commit eb20016

Please sign in to comment.