diff options
author | jsing <> | 2020-09-24 17:59:54 +0000 |
---|---|---|
committer | jsing <> | 2020-09-24 17:59:54 +0000 |
commit | e516f9888833076af8ba7f8c411514db2872aa94 (patch) | |
tree | 1888b2e1b6ea589c37d114a98388a3b495d52958 /src/lib/libssl/d1_pkt.c | |
parent | 8fb9c3782c59e736c9e09323162af3af8028e693 (diff) | |
download | openbsd-e516f9888833076af8ba7f8c411514db2872aa94.tar.gz openbsd-e516f9888833076af8ba7f8c411514db2872aa94.tar.bz2 openbsd-e516f9888833076af8ba7f8c411514db2872aa94.zip |
Release read and write buffers using freezero().
Provide a ssl3_release_buffer() function that correctly frees a buffer
and call it from the appropriate locations. While here also change
ssl3_release_{read,write}_buffer() to void since they cannot fail and
no callers check the return value currently.
ok beck@ inoguchi@ tb@
Diffstat (limited to 'src/lib/libssl/d1_pkt.c')
-rw-r--r-- | src/lib/libssl/d1_pkt.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/lib/libssl/d1_pkt.c b/src/lib/libssl/d1_pkt.c index 748ff988da..31ea52fcae 100644 --- a/src/lib/libssl/d1_pkt.c +++ b/src/lib/libssl/d1_pkt.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: d1_pkt.c,v 1.81 2020/08/30 15:40:19 jsing Exp $ */ | 1 | /* $OpenBSD: d1_pkt.c,v 1.82 2020/09/24 17:59:54 jsing Exp $ */ |
2 | /* | 2 | /* |
3 | * DTLS implementation written by Nagendra Modadugu | 3 | * DTLS implementation written by Nagendra Modadugu |
4 | * (nagendra@cs.stanford.edu) for the OpenSSL project 2005. | 4 | * (nagendra@cs.stanford.edu) for the OpenSSL project 2005. |
@@ -200,7 +200,7 @@ dtls1_copy_record(SSL *s, pitem *item) | |||
200 | 200 | ||
201 | rdata = (DTLS1_RECORD_DATA_INTERNAL *)item->data; | 201 | rdata = (DTLS1_RECORD_DATA_INTERNAL *)item->data; |
202 | 202 | ||
203 | free(S3I(s)->rbuf.buf); | 203 | ssl3_release_buffer(&S3I(s)->rbuf); |
204 | 204 | ||
205 | s->internal->packet = rdata->packet; | 205 | s->internal->packet = rdata->packet; |
206 | s->internal->packet_length = rdata->packet_length; | 206 | s->internal->packet_length = rdata->packet_length; |
@@ -251,7 +251,7 @@ dtls1_buffer_record(SSL *s, record_pqueue *queue, unsigned char *priority) | |||
251 | return (1); | 251 | return (1); |
252 | 252 | ||
253 | err: | 253 | err: |
254 | free(rdata->rbuf.buf); | 254 | ssl3_release_buffer(&rdata->rbuf); |
255 | 255 | ||
256 | init_err: | 256 | init_err: |
257 | SSLerror(s, ERR_R_INTERNAL_ERROR); | 257 | SSLerror(s, ERR_R_INTERNAL_ERROR); |