From ff8194774ca2d8e30223c6f8e2583112514e9fb7 Mon Sep 17 00:00:00 2001 From: Matt Caswell Date: Thu, 29 Sep 2016 14:39:47 +0100 Subject: [PATCH] Address style feedback comments Reviewed-by: Rich Salz --- ssl/packet.c | 2 +- ssl/statem/statem_srvr.c | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/ssl/packet.c b/ssl/packet.c index 7c240a4a82..2a8fe2541c 100644 --- a/ssl/packet.c +++ b/ssl/packet.c @@ -16,9 +16,9 @@ int WPACKET_allocate_bytes(WPACKET *pkt, size_t len, unsigned char **allocbytes) { if (!WPACKET_reserve_bytes(pkt, len, allocbytes)) return 0; + pkt->written += len; pkt->curr += len; - return 1; } diff --git a/ssl/statem/statem_srvr.c b/ssl/statem/statem_srvr.c index 7a14c4487d..3c3544ce23 100644 --- a/ssl/statem/statem_srvr.c +++ b/ssl/statem/statem_srvr.c @@ -1813,6 +1813,7 @@ int tls_construct_server_key_exchange(SSL *s) */ if ((i == 2) && (type & (SSL_kDHE | SSL_kDHEPSK))) { size_t len = BN_num_bytes(r[0]) - BN_num_bytes(r[2]); + if (len > 0) { if (!WPACKET_allocate_bytes(&pkt, len, &binval)) { SSLerr(SSL_F_TLS_CONSTRUCT_SERVER_KEY_EXCHANGE,