From: Matt Caswell Date: Fri, 27 Jan 2017 12:05:52 +0000 (+0000) Subject: Use for loop in WPACKET_fill_lengths instead of do...while X-Git-Tag: OpenSSL_1_1_1-pre1~2541 X-Git-Url: https://git.openssl.org/gitweb/?p=openssl.git;a=commitdiff_plain;h=fed60a781c3da1e91aa90df68f062bf577a2b24a;ds=sidebyside Use for loop in WPACKET_fill_lengths instead of do...while Based on review feedback Reviewed-by: Rich Salz (Merged from https://github.com/openssl/openssl/pull/2259) --- diff --git a/ssl/packet.c b/ssl/packet.c index 87473fbbce..3479f1fed8 100644 --- a/ssl/packet.c +++ b/ssl/packet.c @@ -232,12 +232,10 @@ int WPACKET_fill_lengths(WPACKET *pkt) if (pkt->subs == NULL) return 0; - sub = pkt->subs; - do { + for (sub = pkt->subs; sub != NULL; sub = sub->parent) { if (!wpacket_intern_close(pkt, sub, 0)) return 0; - sub = sub->parent; - } while (sub != NULL); + } return 1; }