summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortedu <>2014-06-30 14:13:27 +0000
committertedu <>2014-06-30 14:13:27 +0000
commit9212388050af9e43bf2dc3b5be5f0e702bdb4587 (patch)
tree2ce716281af05057dc7170444b70c99555f00a60
parentabffb498f545f38a49bd1a499f2ba762720f2df3 (diff)
downloadopenbsd-9212388050af9e43bf2dc3b5be5f0e702bdb4587.tar.gz
openbsd-9212388050af9e43bf2dc3b5be5f0e702bdb4587.tar.bz2
openbsd-9212388050af9e43bf2dc3b5be5f0e702bdb4587.zip
fix the identical leak in three different files.
reported by Brent Cook, original diff by logan
-rw-r--r--src/lib/libssl/d1_srvr.c5
-rw-r--r--src/lib/libssl/s23_srvr.c5
-rw-r--r--src/lib/libssl/s3_srvr.c5
-rw-r--r--src/lib/libssl/src/ssl/d1_srvr.c5
-rw-r--r--src/lib/libssl/src/ssl/s23_srvr.c5
-rw-r--r--src/lib/libssl/src/ssl/s3_srvr.c5
6 files changed, 18 insertions, 12 deletions
diff --git a/src/lib/libssl/d1_srvr.c b/src/lib/libssl/d1_srvr.c
index 1c4b2e9f6d..d4d564a688 100644
--- a/src/lib/libssl/d1_srvr.c
+++ b/src/lib/libssl/d1_srvr.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: d1_srvr.c,v 1.26 2014/06/12 15:49:31 deraadt Exp $ */ 1/* $OpenBSD: d1_srvr.c,v 1.27 2014/06/30 14:13:27 tedu 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.
@@ -176,7 +176,6 @@ dtls1_get_server_method(int ver)
176int 176int
177dtls1_accept(SSL *s) 177dtls1_accept(SSL *s)
178{ 178{
179 BUF_MEM *buf;
180 void (*cb)(const SSL *ssl, int type, int val) = NULL; 179 void (*cb)(const SSL *ssl, int type, int val) = NULL;
181 unsigned long alg_k; 180 unsigned long alg_k;
182 int ret = -1; 181 int ret = -1;
@@ -241,11 +240,13 @@ dtls1_accept(SSL *s)
241 s->type = SSL_ST_ACCEPT; 240 s->type = SSL_ST_ACCEPT;
242 241
243 if (s->init_buf == NULL) { 242 if (s->init_buf == NULL) {
243 BUF_MEM *buf;
244 if ((buf = BUF_MEM_new()) == NULL) { 244 if ((buf = BUF_MEM_new()) == NULL) {
245 ret = -1; 245 ret = -1;
246 goto end; 246 goto end;
247 } 247 }
248 if (!BUF_MEM_grow(buf, SSL3_RT_MAX_PLAIN_LENGTH)) { 248 if (!BUF_MEM_grow(buf, SSL3_RT_MAX_PLAIN_LENGTH)) {
249 BUF_MEM_free(buf);
249 ret = -1; 250 ret = -1;
250 goto end; 251 goto end;
251 } 252 }
diff --git a/src/lib/libssl/s23_srvr.c b/src/lib/libssl/s23_srvr.c
index 52dc261814..cd1a5174a7 100644
--- a/src/lib/libssl/s23_srvr.c
+++ b/src/lib/libssl/s23_srvr.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: s23_srvr.c,v 1.28 2014/06/12 15:49:31 deraadt Exp $ */ 1/* $OpenBSD: s23_srvr.c,v 1.29 2014/06/30 14:13:27 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 *
@@ -174,7 +174,6 @@ ssl23_get_server_method(int ver)
174int 174int
175ssl23_accept(SSL *s) 175ssl23_accept(SSL *s)
176{ 176{
177 BUF_MEM *buf;
178 void (*cb)(const SSL *ssl, int type, int val) = NULL; 177 void (*cb)(const SSL *ssl, int type, int val) = NULL;
179 int ret = -1; 178 int ret = -1;
180 int new_state, state; 179 int new_state, state;
@@ -208,11 +207,13 @@ ssl23_accept(SSL *s)
208 s->type = SSL_ST_ACCEPT; 207 s->type = SSL_ST_ACCEPT;
209 208
210 if (s->init_buf == NULL) { 209 if (s->init_buf == NULL) {
210 BUF_MEM *buf;
211 if ((buf = BUF_MEM_new()) == NULL) { 211 if ((buf = BUF_MEM_new()) == NULL) {
212 ret = -1; 212 ret = -1;
213 goto end; 213 goto end;
214 } 214 }
215 if (!BUF_MEM_grow(buf, SSL3_RT_MAX_PLAIN_LENGTH)) { 215 if (!BUF_MEM_grow(buf, SSL3_RT_MAX_PLAIN_LENGTH)) {
216 BUF_MEM_free(buf);
216 ret = -1; 217 ret = -1;
217 goto end; 218 goto end;
218 } 219 }
diff --git a/src/lib/libssl/s3_srvr.c b/src/lib/libssl/s3_srvr.c
index 161534295f..a3387040a9 100644
--- a/src/lib/libssl/s3_srvr.c
+++ b/src/lib/libssl/s3_srvr.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: s3_srvr.c,v 1.66 2014/06/19 21:29:51 tedu Exp $ */ 1/* $OpenBSD: s3_srvr.c,v 1.67 2014/06/30 14:13:27 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 *
@@ -214,7 +214,6 @@ ssl3_get_server_method(int ver)
214int 214int
215ssl3_accept(SSL *s) 215ssl3_accept(SSL *s)
216{ 216{
217 BUF_MEM *buf;
218 unsigned long alg_k; 217 unsigned long alg_k;
219 void (*cb)(const SSL *ssl, int type, int val) = NULL; 218 void (*cb)(const SSL *ssl, int type, int val) = NULL;
220 int ret = -1; 219 int ret = -1;
@@ -264,12 +263,14 @@ ssl3_accept(SSL *s)
264 s->type = SSL_ST_ACCEPT; 263 s->type = SSL_ST_ACCEPT;
265 264
266 if (s->init_buf == NULL) { 265 if (s->init_buf == NULL) {
266 BUF_MEM *buf;
267 if ((buf = BUF_MEM_new()) == NULL) { 267 if ((buf = BUF_MEM_new()) == NULL) {
268 ret = -1; 268 ret = -1;
269 goto end; 269 goto end;
270 } 270 }
271 if (!BUF_MEM_grow(buf, 271 if (!BUF_MEM_grow(buf,
272 SSL3_RT_MAX_PLAIN_LENGTH)) { 272 SSL3_RT_MAX_PLAIN_LENGTH)) {
273 BUF_MEM_free(buf);
273 ret = -1; 274 ret = -1;
274 goto end; 275 goto end;
275 } 276 }
diff --git a/src/lib/libssl/src/ssl/d1_srvr.c b/src/lib/libssl/src/ssl/d1_srvr.c
index 1c4b2e9f6d..d4d564a688 100644
--- a/src/lib/libssl/src/ssl/d1_srvr.c
+++ b/src/lib/libssl/src/ssl/d1_srvr.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: d1_srvr.c,v 1.26 2014/06/12 15:49:31 deraadt Exp $ */ 1/* $OpenBSD: d1_srvr.c,v 1.27 2014/06/30 14:13:27 tedu 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.
@@ -176,7 +176,6 @@ dtls1_get_server_method(int ver)
176int 176int
177dtls1_accept(SSL *s) 177dtls1_accept(SSL *s)
178{ 178{
179 BUF_MEM *buf;
180 void (*cb)(const SSL *ssl, int type, int val) = NULL; 179 void (*cb)(const SSL *ssl, int type, int val) = NULL;
181 unsigned long alg_k; 180 unsigned long alg_k;
182 int ret = -1; 181 int ret = -1;
@@ -241,11 +240,13 @@ dtls1_accept(SSL *s)
241 s->type = SSL_ST_ACCEPT; 240 s->type = SSL_ST_ACCEPT;
242 241
243 if (s->init_buf == NULL) { 242 if (s->init_buf == NULL) {
243 BUF_MEM *buf;
244 if ((buf = BUF_MEM_new()) == NULL) { 244 if ((buf = BUF_MEM_new()) == NULL) {
245 ret = -1; 245 ret = -1;
246 goto end; 246 goto end;
247 } 247 }
248 if (!BUF_MEM_grow(buf, SSL3_RT_MAX_PLAIN_LENGTH)) { 248 if (!BUF_MEM_grow(buf, SSL3_RT_MAX_PLAIN_LENGTH)) {
249 BUF_MEM_free(buf);
249 ret = -1; 250 ret = -1;
250 goto end; 251 goto end;
251 } 252 }
diff --git a/src/lib/libssl/src/ssl/s23_srvr.c b/src/lib/libssl/src/ssl/s23_srvr.c
index 52dc261814..cd1a5174a7 100644
--- a/src/lib/libssl/src/ssl/s23_srvr.c
+++ b/src/lib/libssl/src/ssl/s23_srvr.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: s23_srvr.c,v 1.28 2014/06/12 15:49:31 deraadt Exp $ */ 1/* $OpenBSD: s23_srvr.c,v 1.29 2014/06/30 14:13:27 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 *
@@ -174,7 +174,6 @@ ssl23_get_server_method(int ver)
174int 174int
175ssl23_accept(SSL *s) 175ssl23_accept(SSL *s)
176{ 176{
177 BUF_MEM *buf;
178 void (*cb)(const SSL *ssl, int type, int val) = NULL; 177 void (*cb)(const SSL *ssl, int type, int val) = NULL;
179 int ret = -1; 178 int ret = -1;
180 int new_state, state; 179 int new_state, state;
@@ -208,11 +207,13 @@ ssl23_accept(SSL *s)
208 s->type = SSL_ST_ACCEPT; 207 s->type = SSL_ST_ACCEPT;
209 208
210 if (s->init_buf == NULL) { 209 if (s->init_buf == NULL) {
210 BUF_MEM *buf;
211 if ((buf = BUF_MEM_new()) == NULL) { 211 if ((buf = BUF_MEM_new()) == NULL) {
212 ret = -1; 212 ret = -1;
213 goto end; 213 goto end;
214 } 214 }
215 if (!BUF_MEM_grow(buf, SSL3_RT_MAX_PLAIN_LENGTH)) { 215 if (!BUF_MEM_grow(buf, SSL3_RT_MAX_PLAIN_LENGTH)) {
216 BUF_MEM_free(buf);
216 ret = -1; 217 ret = -1;
217 goto end; 218 goto end;
218 } 219 }
diff --git a/src/lib/libssl/src/ssl/s3_srvr.c b/src/lib/libssl/src/ssl/s3_srvr.c
index 161534295f..a3387040a9 100644
--- a/src/lib/libssl/src/ssl/s3_srvr.c
+++ b/src/lib/libssl/src/ssl/s3_srvr.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: s3_srvr.c,v 1.66 2014/06/19 21:29:51 tedu Exp $ */ 1/* $OpenBSD: s3_srvr.c,v 1.67 2014/06/30 14:13:27 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 *
@@ -214,7 +214,6 @@ ssl3_get_server_method(int ver)
214int 214int
215ssl3_accept(SSL *s) 215ssl3_accept(SSL *s)
216{ 216{
217 BUF_MEM *buf;
218 unsigned long alg_k; 217 unsigned long alg_k;
219 void (*cb)(const SSL *ssl, int type, int val) = NULL; 218 void (*cb)(const SSL *ssl, int type, int val) = NULL;
220 int ret = -1; 219 int ret = -1;
@@ -264,12 +263,14 @@ ssl3_accept(SSL *s)
264 s->type = SSL_ST_ACCEPT; 263 s->type = SSL_ST_ACCEPT;
265 264
266 if (s->init_buf == NULL) { 265 if (s->init_buf == NULL) {
266 BUF_MEM *buf;
267 if ((buf = BUF_MEM_new()) == NULL) { 267 if ((buf = BUF_MEM_new()) == NULL) {
268 ret = -1; 268 ret = -1;
269 goto end; 269 goto end;
270 } 270 }
271 if (!BUF_MEM_grow(buf, 271 if (!BUF_MEM_grow(buf,
272 SSL3_RT_MAX_PLAIN_LENGTH)) { 272 SSL3_RT_MAX_PLAIN_LENGTH)) {
273 BUF_MEM_free(buf);
273 ret = -1; 274 ret = -1;
274 goto end; 275 goto end;
275 } 276 }