diff options
| author | tedu <> | 2014-06-30 14:13:27 +0000 |
|---|---|---|
| committer | tedu <> | 2014-06-30 14:13:27 +0000 |
| commit | 72c8452709f953ecd1468c04567d78b677517404 (patch) | |
| tree | 2ce716281af05057dc7170444b70c99555f00a60 /src | |
| parent | 4b71508bcd4063ad199844c8dce9941a6767325a (diff) | |
| download | openbsd-72c8452709f953ecd1468c04567d78b677517404.tar.gz openbsd-72c8452709f953ecd1468c04567d78b677517404.tar.bz2 openbsd-72c8452709f953ecd1468c04567d78b677517404.zip | |
fix the identical leak in three different files.
reported by Brent Cook, original diff by logan
Diffstat (limited to 'src')
| -rw-r--r-- | src/lib/libssl/d1_srvr.c | 5 | ||||
| -rw-r--r-- | src/lib/libssl/s23_srvr.c | 5 | ||||
| -rw-r--r-- | src/lib/libssl/s3_srvr.c | 5 | ||||
| -rw-r--r-- | src/lib/libssl/src/ssl/d1_srvr.c | 5 | ||||
| -rw-r--r-- | src/lib/libssl/src/ssl/s23_srvr.c | 5 | ||||
| -rw-r--r-- | src/lib/libssl/src/ssl/s3_srvr.c | 5 |
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) | |||
| 176 | int | 176 | int |
| 177 | dtls1_accept(SSL *s) | 177 | dtls1_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) | |||
| 174 | int | 174 | int |
| 175 | ssl23_accept(SSL *s) | 175 | ssl23_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) | |||
| 214 | int | 214 | int |
| 215 | ssl3_accept(SSL *s) | 215 | ssl3_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) | |||
| 176 | int | 176 | int |
| 177 | dtls1_accept(SSL *s) | 177 | dtls1_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) | |||
| 174 | int | 174 | int |
| 175 | ssl23_accept(SSL *s) | 175 | ssl23_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) | |||
| 214 | int | 214 | int |
| 215 | ssl3_accept(SSL *s) | 215 | ssl3_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 | } |
