@ -943,7 +943,7 @@ static int SigTest15 (void)
uint8_t * buf = ( uint8_t * )
" CONNECT 213.92.8.7:31204 HTTP/1.1 " ;
uint16_t buflen = strlen ( ( char * ) buf ) ;
Packet * p = SCMalloc( SIZE_OF_PACKET ) ;
Packet * p = PacketGetFromAlloc( ) ;
if ( unlikely ( p = = NULL ) )
return 0 ;
ThreadVars th_v ;
@ -951,7 +951,6 @@ static int SigTest15 (void)
int result = 0 ;
memset ( & th_v , 0 , sizeof ( th_v ) ) ;
memset ( p , 0 , SIZE_OF_PACKET ) ;
p - > src . family = AF_INET ;
p - > dst . family = AF_INET ;
p - > payload = buf ;
@ -1102,7 +1101,7 @@ static int SigTest18 (void)
uint8_t * buf = ( uint8_t * )
" 220 (vsFTPd 2.0.5) \r \n " ;
uint16_t buflen = strlen ( ( char * ) buf ) ;
Packet * p = SCMalloc( SIZE_OF_PACKET ) ;
Packet * p = PacketGetFromAlloc( ) ;
if ( unlikely ( p = = NULL ) )
return 0 ;
ThreadVars th_v ;
@ -1110,7 +1109,6 @@ static int SigTest18 (void)
int result = 0 ;
memset ( & th_v , 0 , sizeof ( th_v ) ) ;
memset ( p , 0 , SIZE_OF_PACKET ) ;
p - > src . family = AF_INET ;
p - > dst . family = AF_INET ;
p - > payload = buf ;
@ -1155,7 +1153,7 @@ static int SigTest19 (void)
uint8_t * buf = ( uint8_t * )
" 220 (vsFTPd 2.0.5) \r \n " ;
uint16_t buflen = strlen ( ( char * ) buf ) ;
Packet * p = SCMalloc( SIZE_OF_PACKET ) ;
Packet * p = PacketGetFromAlloc( ) ;
if ( unlikely ( p = = NULL ) )
return 0 ;
ThreadVars th_v ;
@ -1163,7 +1161,6 @@ static int SigTest19 (void)
int result = 0 ;
memset ( & th_v , 0 , sizeof ( th_v ) ) ;
memset ( p , 0 , SIZE_OF_PACKET ) ;
p - > src . family = AF_INET ;
p - > src . addr_data32 [ 0 ] = UTHSetIPv4Address ( " 192.168.0.1 " ) ;
p - > dst . addr_data32 [ 0 ] = UTHSetIPv4Address ( " 1.2.3.4 " ) ;
@ -1216,7 +1213,7 @@ static int SigTest20 (void)
uint8_t * buf = ( uint8_t * )
" 220 (vsFTPd 2.0.5) \r \n " ;
uint16_t buflen = strlen ( ( char * ) buf ) ;
Packet * p = SCMalloc( SIZE_OF_PACKET ) ;
Packet * p = PacketGetFromAlloc( ) ;
if ( unlikely ( p = = NULL ) )
return 0 ;
ThreadVars th_v ;
@ -1224,7 +1221,6 @@ static int SigTest20 (void)
int result = 0 ;
memset ( & th_v , 0 , sizeof ( th_v ) ) ;
memset ( p , 0 , SIZE_OF_PACKET ) ;
p - > src . family = AF_INET ;
p - > src . addr_data32 [ 0 ] = UTHSetIPv4Address ( " 192.168.0.1 " ) ;
p - > dst . addr_data32 [ 0 ] = UTHSetIPv4Address ( " 1.2.3.4 " ) ;
@ -1513,10 +1509,10 @@ static int SigTest24IPV4Keyword(void)
0x40 , 0x01 , 0xb7 , 0x52 , 0xc0 , 0xa8 , 0x01 , 0x03 ,
0xc0 , 0xa8 , 0x01 , 0x06 } ;
Packet * p1 = SCMalloc( SIZE_OF_PACKET ) ;
Packet * p1 = PacketGetFromAlloc( ) ;
if ( unlikely ( p1 = = NULL ) )
return 0 ;
Packet * p2 = SCMalloc( SIZE_OF_PACKET ) ;
Packet * p2 = PacketGetFromAlloc( ) ;
if ( unlikely ( p2 = = NULL ) ) {
SCFree ( p1 ) ;
return 0 ;
@ -1530,8 +1526,6 @@ static int SigTest24IPV4Keyword(void)
uint16_t buflen = strlen ( ( char * ) buf ) ;
memset ( & th_v , 0 , sizeof ( ThreadVars ) ) ;
memset ( p1 , 0 , SIZE_OF_PACKET ) ;
memset ( p2 , 0 , SIZE_OF_PACKET ) ;
PACKET_RESET_CHECKSUMS ( p1 ) ;
PACKET_RESET_CHECKSUMS ( p2 ) ;
@ -1617,10 +1611,10 @@ static int SigTest25NegativeIPV4Keyword(void)
0x40 , 0x01 , 0xb7 , 0x52 , 0xc0 , 0xa8 , 0x01 , 0x03 ,
0xc0 , 0xa8 , 0x01 , 0x06 } ;
Packet * p1 = SCMalloc( SIZE_OF_PACKET ) ;
Packet * p1 = PacketGetFromAlloc( ) ;
if ( unlikely ( p1 = = NULL ) )
return 0 ;
Packet * p2 = SCMalloc( SIZE_OF_PACKET ) ;
Packet * p2 = PacketGetFromAlloc( ) ;
if ( unlikely ( p2 = = NULL ) ) {
SCFree ( p1 ) ;
return 0 ;
@ -1634,8 +1628,6 @@ static int SigTest25NegativeIPV4Keyword(void)
uint16_t buflen = strlen ( ( char * ) buf ) ;
memset ( & th_v , 0 , sizeof ( ThreadVars ) ) ;
memset ( p1 , 0 , SIZE_OF_PACKET ) ;
memset ( p2 , 0 , SIZE_OF_PACKET ) ;
PACKET_RESET_CHECKSUMS ( p1 ) ;
PACKET_RESET_CHECKSUMS ( p2 ) ;
@ -1727,11 +1719,11 @@ static int SigTest26TCPV4Keyword(void)
0x04 , 0x02 , 0x08 , 0x0a , 0x6e , 0x18 , 0x78 , 0x73 ,
0x01 , 0x71 , 0x74 , 0xde , 0x01 , 0x03 , 0x03 , 0x03 } ;
Packet * p1 = SCMalloc( SIZE_OF_PACKET ) ;
Packet * p1 = PacketGetFromAlloc( ) ;
if ( unlikely ( p1 = = NULL ) )
return 0 ;
Packet * p2 = SCMalloc( SIZE_OF_PACKET ) ;
Packet * p2 = PacketGetFromAlloc( ) ;
if ( unlikely ( p2 = = NULL ) ) {
SCFree ( p1 ) ;
return 0 ;
@ -1741,8 +1733,6 @@ static int SigTest26TCPV4Keyword(void)
DetectEngineThreadCtx * det_ctx = NULL ;
memset ( & th_v , 0 , sizeof ( ThreadVars ) ) ;
memset ( p1 , 0 , SIZE_OF_PACKET ) ;
memset ( p2 , 0 , SIZE_OF_PACKET ) ;
PacketCopyData ( p1 , raw_ipv4 , sizeof ( raw_ipv4 ) ) ;
PacketCopyDataOffset ( p1 , GET_PKT_LEN ( p1 ) , valid_raw_tcp , sizeof ( valid_raw_tcp ) ) ;
@ -1826,11 +1816,11 @@ static int SigTest26TCPV4AndNegativeIPV4Keyword(void)
0x04 , 0x02 , 0x08 , 0x0a , 0x6e , 0x18 , 0x78 , 0x73 ,
0x01 , 0x71 , 0x74 , 0xde , 0x01 , 0x03 , 0x03 , 0x03 } ;
Packet * p1 = SCMalloc( SIZE_OF_PACKET ) ;
Packet * p1 = PacketGetFromAlloc( ) ;
if ( unlikely ( p1 = = NULL ) )
return 0 ;
Packet * p2 = SCMalloc( SIZE_OF_PACKET ) ;
Packet * p2 = PacketGetFromAlloc( ) ;
if ( unlikely ( p2 = = NULL ) ) {
SCFree ( p1 ) ;
return 0 ;
@ -1841,8 +1831,6 @@ static int SigTest26TCPV4AndNegativeIPV4Keyword(void)
int result = 0 ;
memset ( & th_v , 0 , sizeof ( ThreadVars ) ) ;
memset ( p1 , 0 , SIZE_OF_PACKET ) ;
memset ( p2 , 0 , SIZE_OF_PACKET ) ;
PacketCopyData ( p1 , raw_ipv4 , sizeof ( raw_ipv4 ) ) ;
PacketCopyDataOffset ( p1 , GET_PKT_LEN ( p1 ) , valid_raw_tcp , sizeof ( valid_raw_tcp ) ) ;
@ -1952,11 +1940,11 @@ static int SigTest26TCPV4AndIPV4Keyword(void)
0x19 , 0x69 , 0x81 , 0x7e , 0xFF , 0xAA , 0x00 , 0x00 ,
0x04 , 0x02 , 0x00 , 0x00 } ;
Packet * p1 = SCMalloc( SIZE_OF_PACKET ) ;
Packet * p1 = PacketGetFromAlloc( ) ;
if ( unlikely ( p1 = = NULL ) )
return 0 ;
Packet * p2 = SCMalloc( SIZE_OF_PACKET ) ;
Packet * p2 = PacketGetFromAlloc( ) ;
if ( unlikely ( p2 = = NULL ) ) {
SCFree ( p1 ) ;
return 0 ;
@ -1967,8 +1955,6 @@ static int SigTest26TCPV4AndIPV4Keyword(void)
int result = 0 ;
memset ( & th_v , 0 , sizeof ( ThreadVars ) ) ;
memset ( p1 , 0 , SIZE_OF_PACKET ) ;
memset ( p2 , 0 , SIZE_OF_PACKET ) ;
PacketCopyData ( p1 , raw_ipv4 , sizeof ( raw_ipv4 ) ) ;
PacketCopyDataOffset ( p1 , GET_PKT_LEN ( p1 ) , valid_raw_tcp , sizeof ( valid_raw_tcp ) ) ;
@ -2067,11 +2053,10 @@ static int SigTest27NegativeTCPV4Keyword(void)
0x04 , 0x02 , 0x08 , 0x0a , 0x6e , 0x18 , 0x78 , 0x73 ,
0x01 , 0x71 , 0x74 , 0xde , 0x01 , 0x03 , 0x03 , 0x03 } ;
Packet * p1 = SCMalloc ( SIZE_OF_PACKET ) ;
Packet * p1 = PacketGetFromAlloc ( ) ;
if ( unlikely ( p1 = = NULL ) )
return 0 ;
Packet * p2 = SCMalloc( SIZE_OF_PACKET ) ;
Packet * p2 = PacketGetFromAlloc( ) ;
if ( unlikely ( p2 = = NULL ) ) {
SCFree ( p1 ) ;
return 0 ;
@ -2081,8 +2066,6 @@ static int SigTest27NegativeTCPV4Keyword(void)
int result = 0 ;
memset ( & th_v , 0 , sizeof ( ThreadVars ) ) ;
memset ( p1 , 0 , SIZE_OF_PACKET ) ;
memset ( p2 , 0 , SIZE_OF_PACKET ) ;
PacketCopyData ( p1 , raw_ipv4 , sizeof ( raw_ipv4 ) ) ;
PacketCopyDataOffset ( p1 , GET_PKT_LEN ( p1 ) , valid_raw_tcp , sizeof ( valid_raw_tcp ) ) ;
@ -2194,10 +2177,10 @@ static int SigTest28TCPV6Keyword(void)
0x01 , 0x01 , 0x08 , 0x0a , 0x00 , 0x08 , 0xca , 0x5a ,
0x00 , 0x01 , 0x69 , 0x28 } ;
Packet * p1 = SCMalloc( SIZE_OF_PACKET ) ;
Packet * p1 = PacketGetFromAlloc( ) ;
if ( unlikely ( p1 = = NULL ) )
return 0 ;
Packet * p2 = SCMalloc( SIZE_OF_PACKET ) ;
Packet * p2 = PacketGetFromAlloc( ) ;
if ( unlikely ( p2 = = NULL ) ) {
SCFree ( p1 ) ;
return 0 ;
@ -2207,8 +2190,6 @@ static int SigTest28TCPV6Keyword(void)
int result = 0 ;
memset ( & th_v , 0 , sizeof ( ThreadVars ) ) ;
memset ( p1 , 0 , SIZE_OF_PACKET ) ;
memset ( p2 , 0 , SIZE_OF_PACKET ) ;
PACKET_RESET_CHECKSUMS ( p1 ) ;
p1 - > ip6h = ( IPV6Hdr * ) ( valid_raw_ipv6 + 14 ) ;
@ -2322,10 +2303,10 @@ static int SigTest29NegativeTCPV6Keyword(void)
0x01 , 0x01 , 0x08 , 0x0a , 0x00 , 0x08 , 0xca , 0x5a ,
0x00 , 0x01 , 0x69 , 0x28 } ;
Packet * p1 = SCMalloc( SIZE_OF_PACKET ) ;
Packet * p1 = PacketGetFromAlloc( ) ;
if ( unlikely ( p1 = = NULL ) )
return 0 ;
Packet * p2 = SCMalloc( SIZE_OF_PACKET ) ;
Packet * p2 = PacketGetFromAlloc( ) ;
if ( unlikely ( p2 = = NULL ) ) {
SCFree ( p1 ) ;
return 0 ;
@ -2335,8 +2316,6 @@ static int SigTest29NegativeTCPV6Keyword(void)
int result = 0 ;
memset ( & th_v , 0 , sizeof ( ThreadVars ) ) ;
memset ( p1 , 0 , SIZE_OF_PACKET ) ;
memset ( p2 , 0 , SIZE_OF_PACKET ) ;
PACKET_RESET_CHECKSUMS ( p1 ) ;
p1 - > ip6h = ( IPV6Hdr * ) ( valid_raw_ipv6 + 14 ) ;
@ -2445,9 +2424,9 @@ static int SigTest30UDPV4Keyword(void)
0x61 , 0x64 , 0x01 , 0x6c , 0x06 , 0x67 , 0x6f , 0x6f ,
0x67 , 0x6c , 0x65 , 0xc0 , 0x27 } ;
Packet * p1 = SCMalloc( SIZE_OF_PACKET ) ;
Packet * p1 = PacketGetFromAlloc( ) ;
FAIL_IF_NULL ( p1 ) ;
Packet * p2 = SCMalloc( SIZE_OF_PACKET ) ;
Packet * p2 = PacketGetFromAlloc( ) ;
FAIL_IF_NULL ( p2 ) ;
ThreadVars th_v ;
@ -2457,8 +2436,6 @@ static int SigTest30UDPV4Keyword(void)
" \r \n \r \n yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy " ;
memset ( & th_v , 0 , sizeof ( ThreadVars ) ) ;
memset ( p1 , 0 , SIZE_OF_PACKET ) ;
memset ( p2 , 0 , SIZE_OF_PACKET ) ;
PACKET_RESET_CHECKSUMS ( p1 ) ;
p1 - > ip4h = ( IPV4Hdr * ) raw_ipv4 ;
@ -2549,10 +2526,10 @@ static int SigTest31NegativeUDPV4Keyword(void)
0x61 , 0x64 , 0x01 , 0x6c , 0x06 , 0x67 , 0x6f , 0x6f ,
0x67 , 0x6c , 0x65 , 0xc0 , 0x27 } ;
Packet * p1 = SCMalloc( SIZE_OF_PACKET ) ;
Packet * p1 = PacketGetFromAlloc( ) ;
if ( unlikely ( p1 = = NULL ) )
return 0 ;
Packet * p2 = SCMalloc( SIZE_OF_PACKET ) ;
Packet * p2 = PacketGetFromAlloc( ) ;
if ( unlikely ( p2 = = NULL ) ) {
SCFree ( p1 ) ;
return 0 ;
@ -2565,8 +2542,6 @@ static int SigTest31NegativeUDPV4Keyword(void)
" \r \n \r \n yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy " ;
memset ( & th_v , 0 , sizeof ( ThreadVars ) ) ;
memset ( p1 , 0 , SIZE_OF_PACKET ) ;
memset ( p2 , 0 , SIZE_OF_PACKET ) ;
PACKET_RESET_CHECKSUMS ( p1 ) ;
p1 - > ip4h = ( IPV4Hdr * ) raw_ipv4 ;
@ -2666,9 +2641,9 @@ static int SigTest32UDPV6Keyword(void)
0x00 , 0x00 , 0xf9 , 0xc8 , 0xe7 , 0x36 , 0x57 , 0xb0 ,
0x09 , 0x01 } ;
Packet * p1 = SCMalloc( SIZE_OF_PACKET ) ;
Packet * p1 = PacketGetFromAlloc( ) ;
FAIL_IF_NULL ( p1 ) ;
Packet * p2 = SCMalloc( SIZE_OF_PACKET ) ;
Packet * p2 = PacketGetFromAlloc( ) ;
FAIL_IF_NULL ( p2 ) ;
ThreadVars th_v ;
@ -2678,8 +2653,6 @@ static int SigTest32UDPV6Keyword(void)
" \r \n \r \n " ;
memset ( & th_v , 0 , sizeof ( ThreadVars ) ) ;
memset ( p1 , 0 , SIZE_OF_PACKET ) ;
memset ( p2 , 0 , SIZE_OF_PACKET ) ;
PACKET_RESET_CHECKSUMS ( p1 ) ;
p1 - > ip6h = ( IPV6Hdr * ) ( valid_raw_ipv6 + 14 ) ;
@ -2763,10 +2736,10 @@ static int SigTest33NegativeUDPV6Keyword(void)
0x00 , 0x00 , 0xf9 , 0xc8 , 0xe7 , 0x36 , 0x57 , 0xb0 ,
0x09 , 0x01 } ;
Packet * p1 = SCMalloc( SIZE_OF_PACKET ) ;
Packet * p1 = PacketGetFromAlloc( ) ;
if ( unlikely ( p1 = = NULL ) )
return 0 ;
Packet * p2 = SCMalloc( SIZE_OF_PACKET ) ;
Packet * p2 = PacketGetFromAlloc( ) ;
if ( unlikely ( p2 = = NULL ) ) {
SCFree ( p1 ) ;
return 0 ;
@ -2779,8 +2752,6 @@ static int SigTest33NegativeUDPV6Keyword(void)
" \r \n \r \n " ;
memset ( & th_v , 0 , sizeof ( ThreadVars ) ) ;
memset ( p1 , 0 , SIZE_OF_PACKET ) ;
memset ( p2 , 0 , SIZE_OF_PACKET ) ;
PACKET_RESET_CHECKSUMS ( p1 ) ;
p1 - > ip6h = ( IPV6Hdr * ) ( valid_raw_ipv6 + 14 ) ;
@ -2880,10 +2851,10 @@ static int SigTest34ICMPV4Keyword(void)
0x2c , 0x2d , 0x2e , 0x2f , 0x30 , 0x31 , 0x32 , 0x33 ,
0x34 , 0x35 , 0x36 , 0x38 } ;
Packet * p1 = SCMalloc( SIZE_OF_PACKET ) ;
Packet * p1 = PacketGetFromAlloc( ) ;
if ( unlikely ( p1 = = NULL ) )
return 0 ;
Packet * p2 = SCMalloc( SIZE_OF_PACKET ) ;
Packet * p2 = PacketGetFromAlloc( ) ;
if ( unlikely ( p2 = = NULL ) ) {
SCFree ( p1 ) ;
return 0 ;
@ -2897,8 +2868,6 @@ static int SigTest34ICMPV4Keyword(void)
uint16_t buflen = strlen ( ( char * ) buf ) ;
memset ( & th_v , 0 , sizeof ( ThreadVars ) ) ;
memset ( p1 , 0 , SIZE_OF_PACKET ) ;
memset ( p2 , 0 , SIZE_OF_PACKET ) ;
PACKET_RESET_CHECKSUMS ( p1 ) ;
p1 - > ip4h = ( IPV4Hdr * ) ( valid_raw_ipv4 ) ;
@ -3000,10 +2969,10 @@ static int SigTest35NegativeICMPV4Keyword(void)
0x2c , 0x2d , 0x2e , 0x2f , 0x30 , 0x31 , 0x32 , 0x33 ,
0x34 , 0x35 , 0x36 , 0x38 } ;
Packet * p1 = SCMalloc( SIZE_OF_PACKET ) ;
Packet * p1 = PacketGetFromAlloc( ) ;
if ( unlikely ( p1 = = NULL ) )
return 0 ;
Packet * p2 = SCMalloc( SIZE_OF_PACKET ) ;
Packet * p2 = PacketGetFromAlloc( ) ;
if ( unlikely ( p2 = = NULL ) ) {
SCFree ( p1 ) ;
return 0 ;
@ -3017,8 +2986,6 @@ static int SigTest35NegativeICMPV4Keyword(void)
uint16_t buflen = strlen ( ( char * ) buf ) ;
memset ( & th_v , 0 , sizeof ( ThreadVars ) ) ;
memset ( p1 , 0 , SIZE_OF_PACKET ) ;
memset ( p2 , 0 , SIZE_OF_PACKET ) ;
PACKET_RESET_CHECKSUMS ( p1 ) ;
p1 - > ip4h = ( IPV4Hdr * ) ( valid_raw_ipv4 ) ;
@ -3095,7 +3062,7 @@ end:
static int SigTest38 ( void )
{
Packet * p1 = SCMalloc( SIZE_OF_PACKET ) ;
Packet * p1 = PacketGetFromAlloc( ) ;
if ( unlikely ( p1 = = NULL ) )
return 0 ;
ThreadVars th_v ;
@ -3136,7 +3103,6 @@ static int SigTest38(void)
uint16_t buflen = sizeof ( buf ) ;
memset ( & th_v , 0 , sizeof ( ThreadVars ) ) ;
memset ( p1 , 0 , SIZE_OF_PACKET ) ;
/* Copy raw data into packet */
if ( PacketCopyData ( p1 , raw_eth , ethlen ) = = - 1 ) {
@ -3226,7 +3192,7 @@ end:
static int SigTest39 ( void )
{
Packet * p1 = SCMalloc( SIZE_OF_PACKET ) ;
Packet * p1 = PacketGetFromAlloc( ) ;
if ( unlikely ( p1 = = NULL ) )
return 0 ;
ThreadVars th_v ;
@ -3267,7 +3233,6 @@ static int SigTest39(void)
uint16_t buflen = sizeof ( buf ) ;
memset ( & th_v , 0 , sizeof ( ThreadVars ) ) ;
memset ( p1 , 0 , SIZE_OF_PACKET ) ;
/* Copy raw data into packet */
if ( PacketCopyData ( p1 , raw_eth , ethlen ) = = - 1 ) {
@ -3402,7 +3367,7 @@ static int SigTest36ContentAndIsdataatKeywords01 (void)
, 0x65 , 0x72 , 0x65 , 0x3c , 0x2f , 0x41 , 0x3e , 0x2e , 0x0d , 0x0a , 0x3c , 0x2f , 0x42 , 0x4f , 0x44 , 0x59
, 0x3e , 0x3c , 0x2f , 0x48 , 0x54 , 0x4d , 0x4c , 0x3e , 0x0d , 0x0a } ;
Packet * p = SCMalloc( SIZE_OF_PACKET ) ;
Packet * p = PacketGetFromAlloc( ) ;
if ( unlikely ( p = = NULL ) )
return 0 ;
DecodeThreadVars dtv ;
@ -3410,7 +3375,6 @@ static int SigTest36ContentAndIsdataatKeywords01 (void)
ThreadVars th_v ;
DetectEngineThreadCtx * det_ctx = NULL ;
memset ( p , 0 , SIZE_OF_PACKET ) ;
memset ( & dtv , 0 , sizeof ( DecodeThreadVars ) ) ;
memset ( & th_v , 0 , sizeof ( th_v ) ) ;
@ -3521,7 +3485,7 @@ static int SigTest37ContentAndIsdataatKeywords02 (void)
, 0x65 , 0x72 , 0x65 , 0x3c , 0x2f , 0x41 , 0x3e , 0x2e , 0x0d , 0x0a , 0x3c , 0x2f , 0x42 , 0x4f , 0x44 , 0x59
, 0x3e , 0x3c , 0x2f , 0x48 , 0x54 , 0x4d , 0x4c , 0x3e , 0x0d , 0x0a } ;
Packet * p = SCMalloc( SIZE_OF_PACKET ) ;
Packet * p = PacketGetFromAlloc( ) ;
if ( unlikely ( p = = NULL ) )
return 0 ;
DecodeThreadVars dtv ;
@ -3529,7 +3493,6 @@ static int SigTest37ContentAndIsdataatKeywords02 (void)
ThreadVars th_v ;
DetectEngineThreadCtx * det_ctx = NULL ;
memset ( p , 0 , SIZE_OF_PACKET ) ;
memset ( & dtv , 0 , sizeof ( DecodeThreadVars ) ) ;
memset ( & th_v , 0 , sizeof ( th_v ) ) ;
@ -3612,7 +3575,7 @@ static int SigTest40NoPacketInspection01(void)
uint8_t * buf = ( uint8_t * )
" 220 (vsFTPd 2.0.5) \r \n " ;
uint16_t buflen = strlen ( ( char * ) buf ) ;
Packet * p = SCMalloc( SIZE_OF_PACKET ) ;
Packet * p = PacketGetFromAlloc( ) ;
TCPHdr tcphdr ;
if ( unlikely ( p = = NULL ) )
return 0 ;
@ -3623,7 +3586,6 @@ static int SigTest40NoPacketInspection01(void)
int result = 0 ;
memset ( & th_v , 0 , sizeof ( th_v ) ) ;
memset ( p , 0 , SIZE_OF_PACKET ) ;
memset ( & pq , 0 , sizeof ( pq ) ) ;
memset ( & f , 0 , sizeof ( f ) ) ;
memset ( & tcphdr , 0 , sizeof ( tcphdr ) ) ;
@ -3691,9 +3653,8 @@ static int SigTest40NoPayloadInspection02(void)
ThreadVars th_v ;
memset ( & th_v , 0 , sizeof ( th_v ) ) ;
Packet * p = SCMalloc( SIZE_OF_PACKET ) ;
Packet * p = PacketGetFromAlloc( ) ;
FAIL_IF_NULL ( p ) ;
memset ( p , 0 , SIZE_OF_PACKET ) ;
p - > src . family = AF_INET ;
p - > dst . family = AF_INET ;
@ -3734,7 +3695,7 @@ static int SigTestMemory01 (void)
" Host: two.example.org \r \n "
" \r \n \r \n " ;
uint16_t buflen = strlen ( ( char * ) buf ) ;
Packet * p = SCMalloc( SIZE_OF_PACKET ) ;
Packet * p = PacketGetFromAlloc( ) ;
if ( unlikely ( p = = NULL ) )
return 0 ;
ThreadVars th_v ;
@ -3742,7 +3703,6 @@ static int SigTestMemory01 (void)
int result = 0 ;
memset ( & th_v , 0 , sizeof ( th_v ) ) ;
memset ( p , 0 , SIZE_OF_PACKET ) ;
p - > src . family = AF_INET ;
p - > dst . family = AF_INET ;
p - > payload = buf ;
@ -4276,10 +4236,9 @@ static int SigTestWithin01 (void)
DetectEngineThreadCtxInit ( & th_v , ( void * ) de_ctx , ( void * ) & det_ctx ) ;
/* packet 1 */
p1 = SCMalloc( SIZE_OF_PACKET ) ;
p1 = PacketGetFromAlloc( ) ;
if ( unlikely ( p1 = = NULL ) )
return 0 ;
memset ( p1 , 0 , SIZE_OF_PACKET ) ;
DecodeEthernet ( & th_v , & dtv , p1 , rawpkt1 , sizeof ( rawpkt1 ) , NULL ) ;
SigMatchSignatures ( & th_v , de_ctx , det_ctx , p1 ) ;
if ( ! ( PacketAlertCheck ( p1 , 556 ) ) ) {
@ -4288,10 +4247,9 @@ static int SigTestWithin01 (void)
}
/* packet 2 */
p2 = SCMalloc( SIZE_OF_PACKET ) ;
p2 = PacketGetFromAlloc( ) ;
if ( unlikely ( p2 = = NULL ) )
return 0 ;
memset ( p2 , 0 , SIZE_OF_PACKET ) ;
DecodeEthernet ( & th_v , & dtv , p2 , rawpkt2 , sizeof ( rawpkt2 ) , NULL ) ;
SigMatchSignatures ( & th_v , de_ctx , det_ctx , p2 ) ;
if ( ! ( PacketAlertCheck ( p2 , 556 ) ) ) {
@ -4300,10 +4258,9 @@ static int SigTestWithin01 (void)
}
/* packet 3 */
p3 = SCMalloc( SIZE_OF_PACKET ) ;
p3 = PacketGetFromAlloc( ) ;
if ( unlikely ( p3 = = NULL ) )
return 0 ;
memset ( p3 , 0 , SIZE_OF_PACKET ) ;
DecodeEthernet ( & th_v , & dtv , p3 , rawpkt3 , sizeof ( rawpkt3 ) , NULL ) ;
SigMatchSignatures ( & th_v , de_ctx , det_ctx , p3 ) ;
if ( ! ( PacketAlertCheck ( p3 , 556 ) ) ) {
@ -4312,10 +4269,9 @@ static int SigTestWithin01 (void)
}
/* packet 4 */
p4 = SCMalloc( SIZE_OF_PACKET ) ;
p4 = PacketGetFromAlloc( ) ;
if ( unlikely ( p4 = = NULL ) )
return 0 ;
memset ( p4 , 0 , SIZE_OF_PACKET ) ;
DecodeEthernet ( & th_v , & dtv , p4 , rawpkt4 , sizeof ( rawpkt4 ) , NULL ) ;
SigMatchSignatures ( & th_v , de_ctx , det_ctx , p4 ) ;
if ( ! ( PacketAlertCheck ( p4 , 556 ) ) ) {