zero the read buffer after copying data to user so it doesn't linger.
authortedu <tedu@openbsd.org>
Sun, 10 Jul 2016 23:07:34 +0000 (23:07 +0000)
committertedu <tedu@openbsd.org>
Sun, 10 Jul 2016 23:07:34 +0000 (23:07 +0000)
ok beck

lib/libssl/s3_pkt.c
lib/libssl/src/ssl/s3_pkt.c

index 153b376..0e97be6 100644 (file)
@@ -1,4 +1,4 @@
-/* $OpenBSD: s3_pkt.c,v 1.57 2015/09/12 16:10:07 doug Exp $ */
+/* $OpenBSD: s3_pkt.c,v 1.58 2016/07/10 23:07:34 tedu Exp $ */
 /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
  * All rights reserved.
  *
@@ -956,6 +956,7 @@ start:
 
                memcpy(buf, &(rr->data[rr->off]), n);
                if (!peek) {
+                       memset(&(rr->data[rr->off]), 0, n);
                        rr->length -= n;
                        rr->off += n;
                        if (rr->length == 0) {
index 153b376..0e97be6 100644 (file)
@@ -1,4 +1,4 @@
-/* $OpenBSD: s3_pkt.c,v 1.57 2015/09/12 16:10:07 doug Exp $ */
+/* $OpenBSD: s3_pkt.c,v 1.58 2016/07/10 23:07:34 tedu Exp $ */
 /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
  * All rights reserved.
  *
@@ -956,6 +956,7 @@ start:
 
                memcpy(buf, &(rr->data[rr->off]), n);
                if (!peek) {
+                       memset(&(rr->data[rr->off]), 0, n);
                        rr->length -= n;
                        rr->off += n;
                        if (rr->length == 0) {