summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authortb <>2022-09-01 15:19:16 +0000
committertb <>2022-09-01 15:19:16 +0000
commit4920b2737b931329f22a832f32d3dcd07c0ac460 (patch)
treea1e215f2dccbfb98f466b25e957dbdedc0515b34 /src
parentc87a5bd4852abc7baefa790a72545c97c889ef08 (diff)
downloadopenbsd-4920b2737b931329f22a832f32d3dcd07c0ac460.tar.gz
openbsd-4920b2737b931329f22a832f32d3dcd07c0ac460.tar.bz2
openbsd-4920b2737b931329f22a832f32d3dcd07c0ac460.zip
Check sk_SSL_CIPHER_push() return value
CID 24797 ok jsing
Diffstat (limited to 'src')
-rw-r--r--src/lib/libssl/ssl_ciph.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/src/lib/libssl/ssl_ciph.c b/src/lib/libssl/ssl_ciph.c
index ffb8b4367a..c42c3fd22d 100644
--- a/src/lib/libssl/ssl_ciph.c
+++ b/src/lib/libssl/ssl_ciph.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: ssl_ciph.c,v 1.130 2022/08/30 20:20:02 tb Exp $ */ 1/* $OpenBSD: ssl_ciph.c,v 1.131 2022/09/01 15:19:16 tb 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 *
@@ -1362,7 +1362,10 @@ ssl_create_cipher_list(const SSL_METHOD *ssl_method,
1362 if (cipher_list_tls13 != NULL) { 1362 if (cipher_list_tls13 != NULL) {
1363 for (i = 0; i < sk_SSL_CIPHER_num(cipher_list_tls13); i++) { 1363 for (i = 0; i < sk_SSL_CIPHER_num(cipher_list_tls13); i++) {
1364 cipher = sk_SSL_CIPHER_value(cipher_list_tls13, i); 1364 cipher = sk_SSL_CIPHER_value(cipher_list_tls13, i);
1365 sk_SSL_CIPHER_push(cipherstack, cipher); 1365 if (!sk_SSL_CIPHER_push(cipherstack, cipher)) {
1366 free(co_list);
1367 return (NULL);
1368 }
1366 } 1369 }
1367 tls13_seen = 1; 1370 tls13_seen = 1;
1368 } 1371 }
@@ -1381,8 +1384,12 @@ ssl_create_cipher_list(const SSL_METHOD *ssl_method,
1381 any_active = 0; 1384 any_active = 0;
1382 for (curr = head; curr != NULL; curr = curr->next) { 1385 for (curr = head; curr != NULL; curr = curr->next) {
1383 if (curr->active || 1386 if (curr->active ||
1384 (!tls13_seen && curr->cipher->algorithm_ssl == SSL_TLSV1_3)) 1387 (!tls13_seen && curr->cipher->algorithm_ssl == SSL_TLSV1_3)) {
1385 sk_SSL_CIPHER_push(cipherstack, curr->cipher); 1388 if (!sk_SSL_CIPHER_push(cipherstack, curr->cipher)) {
1389 free(co_list);
1390 return (NULL);
1391 }
1392 }
1386 any_active |= curr->active; 1393 any_active |= curr->active;
1387 } 1394 }
1388 if (!any_active) 1395 if (!any_active)