From: Matt Caswell Date: Thu, 29 Sep 2016 13:39:47 +0000 (+0100) Subject: Address style feedback comments X-Git-Tag: OpenSSL_1_1_1-pre1~3428 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=ff8194774ca2d8e30223c6f8e2583112514e9fb7;p=oweals%2Fopenssl.git Address style feedback comments Reviewed-by: Rich Salz --- 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,