summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordoug <>2015-07-19 01:07:40 +0000
committerdoug <>2015-07-19 01:07:40 +0000
commit4c6532fa865f38383c75949912e80b64803015c7 (patch)
tree8c06d64d98136b3e3876d010a0e9e56bbaf767f2
parent591df63d95caba9db2372028caaba50b9d296e33 (diff)
downloadopenbsd-4c6532fa865f38383c75949912e80b64803015c7.tar.gz
openbsd-4c6532fa865f38383c75949912e80b64803015c7.tar.bz2
openbsd-4c6532fa865f38383c75949912e80b64803015c7.zip
Assign p to CBS_data since it is used later.
The p initialization was hiding this bug but Coverity 126279 saw it. ok miod@ bcook@ beck@
-rw-r--r--src/lib/libssl/d1_pkt.c5
-rw-r--r--src/lib/libssl/src/ssl/d1_pkt.c5
2 files changed, 6 insertions, 4 deletions
diff --git a/src/lib/libssl/d1_pkt.c b/src/lib/libssl/d1_pkt.c
index b26ff2cec2..c3574b43bd 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.45 2015/07/18 23:00:23 doug Exp $ */ 1/* $OpenBSD: d1_pkt.c,v 1.46 2015/07/19 01:07:40 doug 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.
@@ -492,7 +492,7 @@ again:
492 492
493 /* check if we have the header */ 493 /* check if we have the header */
494 if ((s->rstate != SSL_ST_READ_BODY) || 494 if ((s->rstate != SSL_ST_READ_BODY) ||
495 (s->packet_length < DTLS1_RT_HEADER_LENGTH)) { 495 (s->packet_length < DTLS1_RT_HEADER_LENGTH)) {
496 CBS header, seq_no; 496 CBS header, seq_no;
497 uint16_t epoch, len, ssl_version; 497 uint16_t epoch, len, ssl_version;
498 uint8_t type; 498 uint8_t type;
@@ -544,6 +544,7 @@ again:
544 goto again; 544 goto again;
545 545
546 /* now s->rstate == SSL_ST_READ_BODY */ 546 /* now s->rstate == SSL_ST_READ_BODY */
547 p = (unsigned char *)CBS_data(&header);
547 } 548 }
548 549
549 /* s->rstate == SSL_ST_READ_BODY, get and decode the data */ 550 /* s->rstate == SSL_ST_READ_BODY, get and decode the data */
diff --git a/src/lib/libssl/src/ssl/d1_pkt.c b/src/lib/libssl/src/ssl/d1_pkt.c
index b26ff2cec2..c3574b43bd 100644
--- a/src/lib/libssl/src/ssl/d1_pkt.c
+++ b/src/lib/libssl/src/ssl/d1_pkt.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: d1_pkt.c,v 1.45 2015/07/18 23:00:23 doug Exp $ */ 1/* $OpenBSD: d1_pkt.c,v 1.46 2015/07/19 01:07:40 doug 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.
@@ -492,7 +492,7 @@ again:
492 492
493 /* check if we have the header */ 493 /* check if we have the header */
494 if ((s->rstate != SSL_ST_READ_BODY) || 494 if ((s->rstate != SSL_ST_READ_BODY) ||
495 (s->packet_length < DTLS1_RT_HEADER_LENGTH)) { 495 (s->packet_length < DTLS1_RT_HEADER_LENGTH)) {
496 CBS header, seq_no; 496 CBS header, seq_no;
497 uint16_t epoch, len, ssl_version; 497 uint16_t epoch, len, ssl_version;
498 uint8_t type; 498 uint8_t type;
@@ -544,6 +544,7 @@ again:
544 goto again; 544 goto again;
545 545
546 /* now s->rstate == SSL_ST_READ_BODY */ 546 /* now s->rstate == SSL_ST_READ_BODY */
547 p = (unsigned char *)CBS_data(&header);
547 } 548 }
548 549
549 /* s->rstate == SSL_ST_READ_BODY, get and decode the data */ 550 /* s->rstate == SSL_ST_READ_BODY, get and decode the data */