with padding bytes.
Reviewed-by: Richard Levitte <levitte@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/8611)
BIO *wbio;
long len;
unsigned char *data;
- PACKET pkt = {0}, pkt2 = {0}, pkt3 = {0};
+ PACKET pkt, pkt2, pkt3;
char *dummytick = "Hello World!";
unsigned int type = 0;
int testresult = 0;
return 1;
#endif
+ memset(&pkt, 0, sizeof(pkt));
+ memset(&pkt2, 0, sizeof(pkt2));
+ memset(&pkt3, 0, sizeof(pkt3));
+
/*
* For each test set up an SSL_CTX and SSL and see what ClientHello gets
* produced when we try to connect
unsigned char buf1[BUF_LEN];
const size_t len = 16;
unsigned int i;
- PACKET pkt, short_pkt, subpkt = {0};
+ PACKET pkt, short_pkt, subpkt;
+ memset(&subpkt, 0, sizeof(subpkt));
buf1[0] = (unsigned char)len;
for (i = 1; i < BUF_LEN; i++)
buf1[i] = (i * 2) & 0xff;
unsigned char buf1[1024];
const size_t len = 516; /* 0x0204 */
unsigned int i;
- PACKET pkt, short_pkt, subpkt = {0};
+ PACKET pkt, short_pkt, subpkt;
+ memset(&subpkt, 0, sizeof(subpkt));
for (i = 1; i <= 1024; i++)
buf1[i - 1] = (i * 2) & 0xff;
unsigned char buf1[1024];
const size_t len = 516; /* 0x000204 */
unsigned int i;
- PACKET pkt, short_pkt, subpkt = {0};
+ PACKET pkt, short_pkt, subpkt;
+ memset(&subpkt, 0, sizeof(subpkt));
for (i = 0; i < 1024; i++)
buf1[i] = (i * 2) & 0xff;
unsigned char buf1[BUF_LEN];
const size_t len = 16;
unsigned int i;
- PACKET pkt, exact_pkt, subpkt = {0};
+ PACKET pkt, exact_pkt, subpkt;
+ memset(&subpkt, 0, sizeof(subpkt));
buf1[0] = (unsigned char)len;
for (i = 1; i < BUF_LEN; i++)
buf1[i] = (i * 2) & 0xff;
unsigned char buf[1024];
const size_t len = 516; /* 0x0204 */
unsigned int i;
- PACKET pkt, exact_pkt, subpkt = {0};
+ PACKET pkt, exact_pkt, subpkt;
+ memset(&subpkt, 0, sizeof(subpkt));
for (i = 1; i <= 1024; i++)
buf[i-1] = (i * 2) & 0xff;
{
long len;
unsigned char *data;
- PACKET pkt = {0}, pkt2 = {0}, pkt3 = {0}, pkt4 = {0}, pkt5 = {0};
+ PACKET pkt, pkt2, pkt3, pkt4, pkt5;
unsigned int servname_type = 0, type = 0;
int ret = 0;
+ memset(&pkt, 0, sizeof(pkt));
+ memset(&pkt2, 0, sizeof(pkt2));
+ memset(&pkt3, 0, sizeof(pkt3));
+ memset(&pkt4, 0, sizeof(pkt4));
+ memset(&pkt5, 0, sizeof(pkt5));
+
len = BIO_get_mem_data(bio, (char **)&data);
if (!TEST_true(PACKET_buf_init(&pkt, data, len))
/* Skip the record header */
{
long len;
unsigned char *data;
- PACKET pkt = {0}, pkt2 = {0}, pkt3 = {0};
+ PACKET pkt, pkt2, pkt3;
unsigned int MFL_code = 0, type = 0;
if (!TEST_uint_gt( len = BIO_get_mem_data( bio, (char **) &data ), 0 ) )
goto end;
+ memset(&pkt, 0, sizeof(pkt));
+ memset(&pkt2, 0, sizeof(pkt2));
+ memset(&pkt3, 0, sizeof(pkt3));
+
if (!TEST_true( PACKET_buf_init( &pkt, data, len ) )
/* Skip the record header */
|| !PACKET_forward(&pkt, SSL3_RT_HEADER_LENGTH)