diff options
author | tedu <> | 2016-07-10 23:07:34 +0000 |
---|---|---|
committer | tedu <> | 2016-07-10 23:07:34 +0000 |
commit | d7c491be161f90b935b5e39414759cd545f97ab0 (patch) | |
tree | bfdfe5f0692394a24a80c7a9558b3a55e96debe2 | |
parent | 793bbb74db9be5898f5b404a5091e6ef33f70a51 (diff) | |
download | openbsd-d7c491be161f90b935b5e39414759cd545f97ab0.tar.gz openbsd-d7c491be161f90b935b5e39414759cd545f97ab0.tar.bz2 openbsd-d7c491be161f90b935b5e39414759cd545f97ab0.zip |
zero the read buffer after copying data to user so it doesn't linger.
ok beck
-rw-r--r-- | src/lib/libssl/s3_pkt.c | 3 | ||||
-rw-r--r-- | src/lib/libssl/src/ssl/s3_pkt.c | 3 |
2 files changed, 4 insertions, 2 deletions
diff --git a/src/lib/libssl/s3_pkt.c b/src/lib/libssl/s3_pkt.c index 153b37612f..0e97be6728 100644 --- a/src/lib/libssl/s3_pkt.c +++ b/src/lib/libssl/s3_pkt.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: s3_pkt.c,v 1.57 2015/09/12 16:10:07 doug Exp $ */ | 1 | /* $OpenBSD: s3_pkt.c,v 1.58 2016/07/10 23:07:34 tedu Exp $ */ |
2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) | 2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) |
3 | * All rights reserved. | 3 | * All rights reserved. |
4 | * | 4 | * |
@@ -956,6 +956,7 @@ start: | |||
956 | 956 | ||
957 | memcpy(buf, &(rr->data[rr->off]), n); | 957 | memcpy(buf, &(rr->data[rr->off]), n); |
958 | if (!peek) { | 958 | if (!peek) { |
959 | memset(&(rr->data[rr->off]), 0, n); | ||
959 | rr->length -= n; | 960 | rr->length -= n; |
960 | rr->off += n; | 961 | rr->off += n; |
961 | if (rr->length == 0) { | 962 | if (rr->length == 0) { |
diff --git a/src/lib/libssl/src/ssl/s3_pkt.c b/src/lib/libssl/src/ssl/s3_pkt.c index 153b37612f..0e97be6728 100644 --- a/src/lib/libssl/src/ssl/s3_pkt.c +++ b/src/lib/libssl/src/ssl/s3_pkt.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: s3_pkt.c,v 1.57 2015/09/12 16:10:07 doug Exp $ */ | 1 | /* $OpenBSD: s3_pkt.c,v 1.58 2016/07/10 23:07:34 tedu Exp $ */ |
2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) | 2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) |
3 | * All rights reserved. | 3 | * All rights reserved. |
4 | * | 4 | * |
@@ -956,6 +956,7 @@ start: | |||
956 | 956 | ||
957 | memcpy(buf, &(rr->data[rr->off]), n); | 957 | memcpy(buf, &(rr->data[rr->off]), n); |
958 | if (!peek) { | 958 | if (!peek) { |
959 | memset(&(rr->data[rr->off]), 0, n); | ||
959 | rr->length -= n; | 960 | rr->length -= n; |
960 | rr->off += n; | 961 | rr->off += n; |
961 | if (rr->length == 0) { | 962 | if (rr->length == 0) { |