diff options
author | jsing <> | 2017-07-19 17:45:31 +0000 |
---|---|---|
committer | jsing <> | 2017-07-19 17:45:31 +0000 |
commit | f174662974388d37d30639304fdd547f72608404 (patch) | |
tree | 18864abc944a7c01905d8f0b00d51cf99dcb0acc | |
parent | 55ac24937341a4586566a62b1aae36d4693693b6 (diff) | |
download | openbsd-f174662974388d37d30639304fdd547f72608404.tar.gz openbsd-f174662974388d37d30639304fdd547f72608404.tar.bz2 openbsd-f174662974388d37d30639304fdd547f72608404.zip |
Check the return value of CBB_init_fixed(), since it can fail.
Diffstat (limited to '')
-rw-r--r-- | src/lib/libssl/t1_lib.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/lib/libssl/t1_lib.c b/src/lib/libssl/t1_lib.c index e3046fec09..855ab7ee33 100644 --- a/src/lib/libssl/t1_lib.c +++ b/src/lib/libssl/t1_lib.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: t1_lib.c,v 1.118 2017/07/16 18:14:37 jsing Exp $ */ | 1 | /* $OpenBSD: t1_lib.c,v 1.119 2017/07/19 17:45:31 jsing 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 | * |
@@ -706,7 +706,8 @@ ssl_add_clienthello_tlsext(SSL *s, unsigned char *p, unsigned char *limit) | |||
706 | if (ret >= limit) | 706 | if (ret >= limit) |
707 | return NULL; /* this really never occurs, but ... */ | 707 | return NULL; /* this really never occurs, but ... */ |
708 | 708 | ||
709 | CBB_init_fixed(&cbb, ret, limit - ret); | 709 | if (!CBB_init_fixed(&cbb, ret, limit - ret)) |
710 | return NULL; | ||
710 | if (!tlsext_clienthello_build(s, &cbb)) { | 711 | if (!tlsext_clienthello_build(s, &cbb)) { |
711 | CBB_cleanup(&cbb); | 712 | CBB_cleanup(&cbb); |
712 | return NULL; | 713 | return NULL; |
@@ -991,7 +992,8 @@ ssl_add_serverhello_tlsext(SSL *s, unsigned char *p, unsigned char *limit) | |||
991 | if (ret >= limit) | 992 | if (ret >= limit) |
992 | return NULL; /* this really never occurs, but ... */ | 993 | return NULL; /* this really never occurs, but ... */ |
993 | 994 | ||
994 | CBB_init_fixed(&cbb, ret, limit - ret); | 995 | if (!CBB_init_fixed(&cbb, ret, limit - ret)) |
996 | return NULL; | ||
995 | if (!tlsext_serverhello_build(s, &cbb)) { | 997 | if (!tlsext_serverhello_build(s, &cbb)) { |
996 | CBB_cleanup(&cbb); | 998 | CBB_cleanup(&cbb); |
997 | return NULL; | 999 | return NULL; |