From: Matt Caswell Date: Wed, 26 Aug 2015 15:22:45 +0000 (+0100) Subject: Clean up reset of read/write sequences X-Git-Tag: OpenSSL_1_1_0-pre1~775 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=95cdad6344c72c84761a4da290d384f8de730407;p=oweals%2Fopenssl.git Clean up reset of read/write sequences Use sizeof instead of an explicit size, and use the functions for the purpose. Reviewed-by: Rich Salz --- diff --git a/ssl/record/rec_layer_s3.c b/ssl/record/rec_layer_s3.c index 5b286630ac..6beb8ce35c 100644 --- a/ssl/record/rec_layer_s3.c +++ b/ssl/record/rec_layer_s3.c @@ -166,8 +166,8 @@ void RECORD_LAYER_clear(RECORD_LAYER *rl) SSL3_RECORD_clear(&rl->rrec); SSL3_RECORD_clear(&rl->wrec); - memset(rl->read_sequence, 0, sizeof(rl->read_sequence)); - memset(rl->write_sequence, 0, sizeof(rl->write_sequence)); + RECORD_LAYER_reset_read_sequence(rl); + RECORD_LAYER_reset_write_sequence(rl); if (rl->d) DTLS_RECORD_LAYER_clear(rl); @@ -219,12 +219,12 @@ void RECORD_LAYER_dup(RECORD_LAYER *dst, RECORD_LAYER *src) void RECORD_LAYER_reset_read_sequence(RECORD_LAYER *rl) { - memset(rl->read_sequence, 0, 8); + memset(rl->read_sequence, 0, sizeof(rl->read_sequence)); } void RECORD_LAYER_reset_write_sequence(RECORD_LAYER *rl) { - memset(rl->write_sequence, 0, 8); + memset(rl->write_sequence, 0, sizeof(rl->write_sequence)); } int RECORD_LAYER_setup_comp_buffer(RECORD_LAYER *rl)