@@ -660,7 +660,7 @@ int test_dtls13_ack_order(void)
660660 * uint64 sequence_number;
661661 * } RecordNumber;
662662 * Big endian */
663- unsigned char expected_output [] = {
663+ static const unsigned char expected_output [] = {
664664 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x02 ,
665665 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 ,
666666 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x02 ,
@@ -706,13 +706,18 @@ int test_dtls13_ack_order(void)
706706 ExpectIntEQ (Dtls13RtxAddAck (ssl_c , w64From32 (0 , 2 ), w64From32 (0 , 2 )), 0 );
707707 ExpectIntEQ (Dtls13WriteAckMessage (ssl_c , ssl_c -> dtls13Rtx .seenRecords ,
708708 & length ), 0 );
709+
710+ /* must zero the span reserved for the header to avoid read of uninited
711+ * data.
712+ */
713+ XMEMSET (ssl_c -> buffers .outputBuffer .buffer , 0 ,
714+ 5 /* DTLS13_UNIFIED_HEADER_SIZE */ );
709715 /* N * RecordNumber + 2 extra bytes for length */
710716 ExpectIntEQ (length , sizeof (expected_output ) + 2 );
711717 ExpectNotNull (mymemmem (ssl_c -> buffers .outputBuffer .buffer ,
712718 ssl_c -> buffers .outputBuffer .bufferSize , expected_output ,
713719 sizeof (expected_output )));
714720
715-
716721 wolfSSL_free (ssl_c );
717722 wolfSSL_CTX_free (ctx_c );
718723 wolfSSL_free (ssl_s );
0 commit comments