@@ -129,10 +129,9 @@ void test_DNS_ReadNameField_success_empty_uxRemainingBytes( void )
129129 uint8_t pucByte [ 300 ];
130130 size_t ret ;
131131 ParseSet_t xSet = { 0 };
132- size_t uxDestLen ;
133132
134133 memset ( pucByte , 0x00 , 300 );
135- ret = DNS_ReadNameField ( & xSet , uxDestLen );
134+ ret = DNS_ReadNameField ( & xSet , sizeof ( xSet ) );
136135 TEST_ASSERT_EQUAL ( 0 , ret );
137136}
138137
@@ -145,12 +144,11 @@ void test_DNS_ReadNameField_fail_offset_dns_name( void )
145144 uint8_t pucByte [ 300 ] = { 0 };
146145 size_t ret ;
147146 ParseSet_t xSet = { 0 };
148- size_t uxDestLen ;
149147
150148 memset ( pucByte , 0x00 , 300 );
151149 pucByte [ 0 ] = dnsNAME_IS_OFFSET ;
152150
153- ret = DNS_ReadNameField ( & xSet , uxDestLen );
151+ ret = DNS_ReadNameField ( & xSet , sizeof ( xSet ) );
154152
155153 TEST_ASSERT_EQUAL ( 0 , ret );
156154}
@@ -1284,7 +1282,7 @@ void test_DNS_ParseDNSReply_fail_small_buffer( void )
12841282 size_t uxBufferLength = sizeof ( DNSMessage_t ) - 2 ;
12851283 BaseType_t xExpected = pdFALSE ;
12861284 struct freertos_addrinfo * pxAddressInfo ;
1287- uint16_t usPort ;
1285+ uint16_t usPort = 80 ;
12881286
12891287 ret = DNS_ParseDNSReply ( pucUDPPayloadBuffer ,
12901288 uxBufferLength ,
@@ -1304,7 +1302,7 @@ void test_DNS_ParseDNSReply_fail_no_namefield( void )
13041302 size_t uxBufferLength = 300 ;
13051303 BaseType_t xExpected = pdFALSE ;
13061304 struct freertos_addrinfo * pxAddressInfo ;
1307- uint16_t usPort ;
1305+ uint16_t usPort = 80 ;
13081306
13091307 ret = DNS_ParseDNSReply ( pucUDPPayloadBuffer ,
13101308 uxBufferLength ,
@@ -1326,7 +1324,7 @@ void test_DNS_ParseDNSReply_fail( void )
13261324 BaseType_t xExpected = pdFALSE ;
13271325 int beg = sizeof ( DNSMessage_t );
13281326 struct freertos_addrinfo * pxAddressInfo ;
1329- uint16_t usPort ;
1327+ uint16_t usPort = 80 ;
13301328
13311329 memset ( pucUDPPayloadBuffer , 0x00 , 300 );
13321330
@@ -1353,7 +1351,7 @@ void test_DNS_ParseDNSReply_fail_empty_namefield( void )
13531351 BaseType_t xExpected = pdFALSE ;
13541352 uint8_t beg = sizeof ( DNSMessage_t );
13551353 struct freertos_addrinfo * pxAddressInfo ;
1356- uint16_t usPort ;
1354+ uint16_t usPort = 80 ;
13571355
13581356 memset ( pucUDPPayloadBuffer , 0x00 , uxBufferLength );
13591357 pucUDPPayloadBuffer [ offsetof( DNSMessage_t , usQuestions ) ] = 4 ;
@@ -1382,7 +1380,7 @@ void test_DNS_ParseDNSReply_fail_not_enough_space_lt_32( void )
13821380 size_t uxBufferLength = 250 ;
13831381 char dns [ 64 ];
13841382 struct freertos_addrinfo * pxAddressInfo ;
1385- uint16_t usPort ;
1383+ uint16_t usPort = 80 ;
13861384
13871385 memset ( pucUDPPayloadBuffer , 0x00 , uxBufferLength );
13881386 memset ( dns , 'a' , 64 );
@@ -1440,7 +1438,7 @@ void test_DNS_ParseDNSReply_answer_record_no_answers( void )
14401438 size_t uxBufferLength = 250 ;
14411439 char dns [ 64 ];
14421440 struct freertos_addrinfo * pxAddressInfo ;
1443- uint16_t usPort ;
1441+ uint16_t usPort = 80 ;
14441442 const uint16_t usFlags = ( dnsRX_FLAGS_MASK | dnsEXPECTED_RX_FLAGS );
14451443
14461444 memset ( dns , 'a' , 64 );
@@ -1478,7 +1476,7 @@ void test_DNS_ParseDNSReply_answer_record_no_answers2( void )
14781476 size_t uxBufferLength = 250 ;
14791477 char dns [ 64 ];
14801478 struct freertos_addrinfo * pxAddressInfo ;
1481- uint16_t usPort ;
1479+ uint16_t usPort = 80 ;
14821480 const uint16_t usFlags = dnsEXPECTED_RX_FLAGS ;
14831481
14841482 memset ( dns , 'a' , 64 );
@@ -1516,7 +1514,7 @@ void test_DNS_ParseDNSReply_answer_record_no_questions( void )
15161514 size_t uxBufferLength = 250 ;
15171515 char dns [ 64 ];
15181516 struct freertos_addrinfo * pxAddressInfo ;
1519- uint16_t usPort ;
1517+ uint16_t usPort = 80 ;
15201518 const uint16_t usFlags = dnsEXPECTED_RX_FLAGS ;
15211519
15221520 memset ( dns , 'a' , 64 );
@@ -1561,7 +1559,7 @@ void test_DNS_ParseDNSReply_InvalidEndpointIP( void )
15611559 uint8_t * pucUDPPayloadBuffer = ( ( uint8_t * ) udp_buffer ) + ipUDP_PAYLOAD_OFFSET_IPv4 ;
15621560 size_t uxBufferLength = 250 ;
15631561 struct freertos_addrinfo * pxAddressInfo ;
1564- uint16_t usPort ;
1562+ uint16_t usPort = 80 ;
15651563
15661564 xBufferAllocFixedSize = pdTRUE ;
15671565 uint8_t * nullAddress = NULL ;
@@ -1637,7 +1635,7 @@ void test_DNS_ParseDNSReply_InvalidEndpointType( void )
16371635 uint8_t * pucUDPPayloadBuffer = udp_buffer + prvALIGNED_UDP_PAYLOAD_OFFSET_IPv4 ;
16381636 size_t uxBufferLength = 250 ;
16391637 struct freertos_addrinfo * pxAddressInfo ;
1640- uint16_t usPort ;
1638+ uint16_t usPort = 80 ;
16411639
16421640 xBufferAllocFixedSize = pdTRUE ;
16431641 uint8_t * nullAddress = NULL ;
@@ -1719,7 +1717,7 @@ void test_DNS_ParseDNSReply_answer_record_too_many_answers( void )
17191717 size_t uxBufferLength = 250 ;
17201718 char dns [ 64 ];
17211719 struct freertos_addrinfo * pxAddressInfo ;
1722- uint16_t usPort ;
1720+ uint16_t usPort = 80 ;
17231721
17241722 memset ( dns , 'a' , 64 );
17251723 memset ( pucUDPPayloadBuffer , 0x00 , uxBufferLength );
@@ -1776,7 +1774,7 @@ void test_DNS_ParseDNSReply_answer_lmmnr_reply_xBufferAllocFixedsize( void )
17761774 uint8_t * pucUDPPayloadBuffer = udp_buffer + prvALIGNED_UDP_PAYLOAD_OFFSET_IPv4 ;
17771775 size_t uxBufferLength = 250 ;
17781776 struct freertos_addrinfo * pxAddressInfo ;
1779- uint16_t usPort ;
1777+ uint16_t usPort = 80 ;
17801778
17811779 xBufferAllocFixedSize = pdTRUE ;
17821780 uint8_t * nullAddress = NULL ;
@@ -1854,7 +1852,7 @@ void test_DNS_ParseDNSReply_answer_lmmnr_reply( void )
18541852 uint8_t * pucUDPPayloadBuffer = udp_buffer + prvALIGNED_UDP_PAYLOAD_OFFSET_IPv4 ;
18551853 size_t uxBufferLength = 250 ;
18561854 struct freertos_addrinfo * pxAddressInfo ;
1857- uint16_t usPort ;
1855+ uint16_t usPort = 80 ;
18581856 NetworkEndPoint_t xEndPoint = { 0 };
18591857
18601858 memset ( pucUDPPayloadBuffer , 0x00 , uxBufferLength );
@@ -1927,7 +1925,7 @@ void test_DNS_ParseDNSReply_answer_lmmnr_reply2( void )
19271925 uint8_t * pucUDPPayloadBuffer = ( ( uint8_t * ) udp_buffer ) + ipUDP_PAYLOAD_OFFSET_IPv6 ;
19281926 size_t uxBufferLength = 250 ;
19291927 struct freertos_addrinfo * pxAddressInfo ;
1930- uint16_t usPort ;
1928+ uint16_t usPort = 80 ;
19311929 NetworkEndPoint_t xEndPoint = { 0 };
19321930
19331931 memset ( pucUDPPayloadBuffer , 0x00 , uxBufferLength );
@@ -2000,7 +1998,7 @@ void test_DNS_ParseDNSReply_answer_lmmnr_reply3( void )
20001998 uint8_t * pucUDPPayloadBuffer = ( ( uint8_t * ) udp_buffer ) + ipUDP_PAYLOAD_OFFSET_IPv4 - 1 ;
20011999 size_t uxBufferLength = 250 ;
20022000 struct freertos_addrinfo * pxAddressInfo ;
2003- uint16_t usPort ;
2001+ uint16_t usPort = 80 ;
20042002 NetworkEndPoint_t xEndPoint = { 0 };
20052003
20062004 memset ( pucUDPPayloadBuffer , 0x00 , uxBufferLength );
@@ -2074,7 +2072,7 @@ void test_DNS_ParseDNSReply_answer_lmmnr_reply_diffUsType( void )
20742072 uint8_t * pucUDPPayloadBuffer = ( ( uint8_t * ) udp_buffer ) + ipUDP_PAYLOAD_OFFSET_IPv4 ;
20752073 size_t uxBufferLength = 250 ;
20762074 struct freertos_addrinfo * pxAddressInfo ;
2077- uint16_t usPort ;
2075+ uint16_t usPort = 80 ;
20782076 NetworkEndPoint_t xEndPoint = { 0 };
20792077
20802078 memset ( pucUDPPayloadBuffer , 0x00 , uxBufferLength );
@@ -2151,7 +2149,7 @@ void test_DNS_ParseDNSReply_answer_lmmnr_reply_NullNetworkBuffer( void )
21512149 uint8_t * pucUDPPayloadBuffer = ( ( uint8_t * ) udp_buffer ) + ipUDP_PAYLOAD_OFFSET_IPv4 ;
21522150 size_t uxBufferLength = 250 ;
21532151 struct freertos_addrinfo * pxAddressInfo ;
2154- uint16_t usPort ;
2152+ uint16_t usPort = 80 ;
21552153 NetworkEndPoint_t xEndPoint = { 0 };
21562154
21572155 memset ( pucUDPPayloadBuffer , 0x00 , uxBufferLength );
@@ -2228,7 +2226,7 @@ void test_DNS_ParseDNSReply_answer_lmmnr_reply4( void )
22282226 uint8_t * pucUDPPayloadBuffer = ( ( uint8_t * ) udp_buffer ) + ipUDP_PAYLOAD_OFFSET_IPv4 ;
22292227 size_t uxBufferLength = 250 ;
22302228 struct freertos_addrinfo * pxAddressInfo ;
2231- uint16_t usPort ;
2229+ uint16_t usPort = 80 ;
22322230
22332231 memset ( pucUDPPayloadBuffer , 0x00 , uxBufferLength );
22342232
@@ -2299,7 +2297,7 @@ void test_DNS_ParseDNSReply_answer_lmmnr_reply5( void )
22992297 uint8_t * pucUDPPayloadBuffer = ( ( uint8_t * ) udp_buffer ) + ipUDP_PAYLOAD_OFFSET_IPv4 ;
23002298 size_t uxBufferLength = 250 ;
23012299 struct freertos_addrinfo * pxAddressInfo ;
2302- uint16_t usPort ;
2300+ uint16_t usPort = 80 ;
23032301
23042302 memset ( pucUDPPayloadBuffer , 0x00 , uxBufferLength );
23052303
@@ -2371,7 +2369,7 @@ void test_DNS_ParseDNSReply_answer_lmmnr_reply_query_hook_false( void )
23712369 uint8_t * pucUDPPayloadBuffer = ( ( uint8_t * ) udp_buffer ) + ipUDP_PAYLOAD_OFFSET_IPv4 ;
23722370 struct freertos_addrinfo * pxAddressInfo ;
23732371 struct xNetworkEndPoint xEndPoint = { 0 };
2374- uint16_t usPort ;
2372+ uint16_t usPort = 80 ;
23752373
23762374 memset ( pucUDPPayloadBuffer , 0x0 , 250 );
23772375 size_t uxBufferLength = 250 ;
@@ -2443,7 +2441,7 @@ void test_DNS_ParseDNSReply_answer_lmmnr_reply_null_new_netbuffer( void )
24432441 uint8_t * pucUDPPayloadBuffer = ( ( uint8_t * ) udp_buffer ) + ipUDP_PAYLOAD_OFFSET_IPv4 ;
24442442 size_t uxBufferLength = 250 ;
24452443 struct freertos_addrinfo * pxAddressInfo ;
2446- uint16_t usPort ;
2444+ uint16_t usPort = 80 ;
24472445 NetworkEndPoint_t xEndPoint = { 0 };
24482446
24492447 memset ( pucUDPPayloadBuffer , 0x00 , uxBufferLength );
@@ -2517,7 +2515,7 @@ void test_DNS_ParseDNSReply_answer_lmmnr_reply_null_new_netbuffer2( void )
25172515 uint8_t * pucUDPPayloadBuffer = ( ( uint8_t * ) udp_buffer ) + ipUDP_PAYLOAD_OFFSET_IPv4 ;
25182516 size_t uxBufferLength = 250 ;
25192517 struct freertos_addrinfo * pxAddressInfo ;
2520- uint16_t usPort ;
2518+ uint16_t usPort = 80 ;
25212519 NetworkEndPoint_t xEndPoint = { 0 };
25222520
25232521 memset ( pucUDPPayloadBuffer , 0x00 , uxBufferLength );
@@ -2591,7 +2589,7 @@ void test_DNS_ParseDNSReply_answer_lmmnr_reply_valid_new_netbuffer( void )
25912589 uint8_t * pucUDPPayloadBuffer = ( ( uint8_t * ) udp_buffer ) + ipUDP_PAYLOAD_OFFSET_IPv4 ;
25922590 size_t uxBufferLength = 250 ;
25932591 struct freertos_addrinfo * pxAddressInfo ;
2594- uint16_t usPort ;
2592+ uint16_t usPort = 80 ;
25952593 NetworkEndPoint_t xEndPoint = { 0 };
25962594
25972595 memset ( pucUDPPayloadBuffer , 0x00 , uxBufferLength );
@@ -2683,7 +2681,7 @@ void test_DNS_ParseDNSReply_answer_lmmnr_reply_valid_new_netbuffer2( void )
26832681 uint8_t * pucUDPPayloadBuffer = ( ( uint8_t * ) udp_buffer ) + ipUDP_PAYLOAD_OFFSET_IPv4 ;
26842682 size_t uxBufferLength = 250 ;
26852683 struct freertos_addrinfo * pxAddressInfo ;
2686- uint16_t usPort ;
2684+ uint16_t usPort = 80 ;
26872685 NetworkEndPoint_t xEndPoint = { 0 };
26882686
26892687 memset ( pucUDPPayloadBuffer , 0x00 , uxBufferLength );
@@ -2775,7 +2773,7 @@ void test_DNS_ParseDNSReply_answer_lmmnr_reply_valid_new_netbuffer3( void )
27752773 uint8_t * pucUDPPayloadBuffer = ( ( uint8_t * ) udp_buffer ) + ipUDP_PAYLOAD_OFFSET_IPv4 ;
27762774 size_t uxBufferLength = 250 ;
27772775 struct freertos_addrinfo * pxAddressInfo ;
2778- uint16_t usPort ;
2776+ uint16_t usPort = 80 ;
27792777 NetworkEndPoint_t xEndPoint = { 0 };
27802778
27812779 memset ( pucUDPPayloadBuffer , 0x00 , uxBufferLength );
@@ -2948,7 +2946,7 @@ void test_parseDNSAnswer_recordstored_gt_count( void )
29482946 ip_address .xIPAddress .ulIP_IPv4 = 1234 ;
29492947 ip_address .xIs_IPv6 = pdFALSE ;
29502948 ParseSet_t xSet = { 0 };
2951- struct freertos_addrinfo * pxAddressInfo , * pxAddressInfo_2 ;
2949+ struct freertos_addrinfo * pxAddressInfo = NULL , * pxAddressInfo_2 ;
29522950
29532951 xSet .pxDNSMessageHeader = & pxDNSMessageHeader ;
29542952 xSet .pucByte = pucByte ;
0 commit comments