From f174662974388d37d30639304fdd547f72608404 Mon Sep 17 00:00:00 2001 From: jsing <> Date: Wed, 19 Jul 2017 17:45:31 +0000 Subject: Check the return value of CBB_init_fixed(), since it can fail. --- src/lib/libssl/t1_lib.c | 8 +++++--- 1 file 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 @@ -/* $OpenBSD: t1_lib.c,v 1.118 2017/07/16 18:14:37 jsing Exp $ */ +/* $OpenBSD: t1_lib.c,v 1.119 2017/07/19 17:45:31 jsing Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -706,7 +706,8 @@ ssl_add_clienthello_tlsext(SSL *s, unsigned char *p, unsigned char *limit) if (ret >= limit) return NULL; /* this really never occurs, but ... */ - CBB_init_fixed(&cbb, ret, limit - ret); + if (!CBB_init_fixed(&cbb, ret, limit - ret)) + return NULL; if (!tlsext_clienthello_build(s, &cbb)) { CBB_cleanup(&cbb); return NULL; @@ -991,7 +992,8 @@ ssl_add_serverhello_tlsext(SSL *s, unsigned char *p, unsigned char *limit) if (ret >= limit) return NULL; /* this really never occurs, but ... */ - CBB_init_fixed(&cbb, ret, limit - ret); + if (!CBB_init_fixed(&cbb, ret, limit - ret)) + return NULL; if (!tlsext_serverhello_build(s, &cbb)) { CBB_cleanup(&cbb); return NULL; -- cgit v1.2.3-55-g6feb