if (errno != EINTR)
{
- char error_msg[1024] = {0};
+ char error_msg[1024] = { '\0' };
if (strerror_r(errno, error_msg, sizeof(error_msg)) == 0)
ErrorMessage("TcpC Input Thread: Error polling on socket %d: %s\n", pfds[0].fd, error_msg);
else
if ( listen(sfd, 10) < 0 )
{
- char error_msg[1024] = {0};
+ char error_msg[1024] = { '\0' };
if (strerror_r(errno, error_msg, sizeof(error_msg)) == 0)
ErrorMessage("listen() failure: %s\n", error_msg);
else
if ( (peer_sfd = accept(sfd, nullptr, nullptr )) < 0 )
{
- char error_msg[1024] = {0};
+ char error_msg[1024] = { '\0' };
if (strerror_r(errno, error_msg, sizeof(error_msg)) == 0)
ErrorMessage("accept() failure: %s\n", error_msg);
else
static void fp_print_service_groups(srmm_table_t* srmm)
{
- unsigned to_srv[PM_TYPE_MAX] = { 0 };
- unsigned to_cli[PM_TYPE_MAX] = { 0 };
+ unsigned to_srv[PM_TYPE_MAX] = { };
+ unsigned to_cli[PM_TYPE_MAX] = { };
fp_sum_service_groups(srmm->to_srv, to_srv);
fp_sum_service_groups(srmm->to_cli, to_cli);
static void fp_print_port_groups(RulePortTables* port_tables)
{
- unsigned src[PM_TYPE_MAX] = { 0 };
- unsigned dst[PM_TYPE_MAX] = { 0 };
- unsigned any[PM_TYPE_MAX] = { 0 };
+ unsigned src[PM_TYPE_MAX] = { };
+ unsigned dst[PM_TYPE_MAX] = { };
+ unsigned any[PM_TYPE_MAX] = { };
fp_sum_port_groups(port_tables->ip.src, src);
fp_sum_port_groups(port_tables->ip.dst, dst);
{
HostApplicationInfo() = default;
HostApplicationInfo(const char *ver, const char *ven);
- char vendor[INFO_SIZE] = { 0 };
- char version[INFO_SIZE] = { 0 };
+ char vendor[INFO_SIZE] = { '\0' };
+ char version[INFO_SIZE] = { '\0' };
bool visibility = true;
friend class HostTracker;
bool inferred_appid = false;
uint32_t hits = 0;
uint32_t last_seen = 0;
- char user[INFO_SIZE] = { 0 };
+ char user[INFO_SIZE] = { '\0' };
std::vector<HostApplicationInfo, HostAppInfoAllocator> info;
std::vector<Payload_t, HostCacheAllocIp<Payload_t>> payloads;
HostClient() = default;
HostClient(AppId clientid, const char *ver, AppId ser);
AppId id;
- char version[INFO_SIZE] = { 0 };
+ char version[INFO_SIZE] = { '\0' };
AppId service;
std::vector<Payload_t, HostCacheAllocIp<Payload_t>> payloads;
uint32_t fpid;
uint32_t fp_type;
bool jail_broken;
- char device[INFO_SIZE] = { 0 };
+ char device[INFO_SIZE] = { '\0' };
};
enum HostType : std::uint32_t
char* tmp, * tok;
tmp = snort_strdup(args);
- char* lasts = { nullptr };
+ char* lasts = nullptr;
tok = strtok_r(tmp, " ,", &lasts);
while (tok)
snort_inet_ntop(af, &sip->u6_addr32[(af == AF_INET)? 3 : 0], sipstr, sizeof(sipstr));
snort_inet_ntop(af, &dip->u6_addr32[(af == AF_INET)? 3 : 0], dipstr, sizeof(dipstr));
- char gr_buf[32] = {0};
+ char gr_buf[32] = { '\0' };
if (inter_group_flow)
snprintf(gr_buf, sizeof(gr_buf), " GR=%hd-%hd", sgroup, dgroup);
// functions in tp_appid_utils.cc are static. Thus the public
// set_field() functions in AppIdHttpSession. We do need set functions
// for this array, as old pointers need to be deleted upon set().
- const std::string* meta_data[NUM_METADATA_FIELDS] = { 0 };
+ const std::string* meta_data[NUM_METADATA_FIELDS] = { };
pair_t meta_offset[NUM_HTTP_FIELDS];
bool is_webdav = false;
int num_matches = 0;
int num_scans = 0;
bool skip_simple_detect = false;
- int ptype_req_counts[NUM_HTTP_FIELDS] = { 0 };
- int ptype_scan_counts[NUM_HTTP_FIELDS] = { 0 };
+ int ptype_req_counts[NUM_HTTP_FIELDS] = { };
+ int ptype_scan_counts[NUM_HTTP_FIELDS] = { };
const TunnelDest* tun_dest = nullptr;
#if RESPONSE_CODE_PACKET_THRESHHOLD
unsigned response_code_packets = 0;
class AppIdDynamicPeg
{
public:
- PegCount stats[DetectorPegs::NUM_APPID_DETECTOR_PEGS] = { 0 };
+ PegCount stats[DetectorPegs::NUM_APPID_DETECTOR_PEGS] = { };
bool all_zeros()
{
- PegCount zeroed_peg[DetectorPegs::NUM_APPID_DETECTOR_PEGS] = { 0 };
+ PegCount zeroed_peg[DetectorPegs::NUM_APPID_DETECTOR_PEGS] = { };
return !memcmp(stats, &zeroed_peg, sizeof(stats));
}
{
const uint8_t* s = args.data;
const uint8_t* end = (args.data + args.size);
- char tag[IMAP_TAG_MAX_LEN + 1] = { 0 };
+ char tag[IMAP_TAG_MAX_LEN + 1] = { '\0' };
#ifdef APP_ID_USES_REASSEMBLED
Stream::flush_response_flush(pkt);
PatternService* service_port_pattern = nullptr;
snort::SearchTool* tcp_pattern_matcher = nullptr;
snort::SearchTool* udp_pattern_matcher = nullptr;
- snort::SearchTool* tcp_port_pattern_tree[65536] = { nullptr };
- snort::SearchTool* udp_port_pattern_tree[65536] = { nullptr };
+ snort::SearchTool* tcp_port_pattern_tree[65536] = { };
+ snort::SearchTool* udp_port_pattern_tree[65536] = { };
};
#endif
void HttpPatternMatchers::identify_user_agent(const char* start, int size, AppId& service_id,
AppId& client_id, char** version)
{
- char temp_ver[MAX_VERSION_SIZE] = { 0 };
+ char temp_ver[MAX_VERSION_SIZE] = { '\0' };
MatchedPatterns* mp = nullptr;
client_agent_matcher.find_all(start, size, &http_pattern_match, false, (void*)&mp);
}
HttpFieldIds cur_ptype;
- const char* buffer[NUM_HTTP_FIELDS] = { nullptr };
- uint16_t length[NUM_HTTP_FIELDS] = { 0 };
+ const char* buffer[NUM_HTTP_FIELDS] = { };
+ uint16_t length[NUM_HTTP_FIELDS] = { };
std::list<MatchedCHPAction> chp_matches[NUM_HTTP_FIELDS];
CHPMatchTally match_tally;
actual_sip->ntop(sipstr, sizeof(sipstr));
actual_dip->ntop(dipstr, sizeof(dipstr));
- char gr_buf[32] = {0};
+ char gr_buf[32] = { '\0' };
if (p.is_inter_group_flow())
snprintf(gr_buf, sizeof(gr_buf), " GR=%hd-%hd", p.pkth->ingress_group,
p.pkth->egress_group);
#ifdef DEBUG_MSGS
static inline void rna_logger_message(const RnaLoggerEvent& rle)
{
- char macbuf[19] = { 0 };
+ char macbuf[19] = { '\0' };
if ( rle.mac )
snprintf(macbuf, 19, "%02X:%02X:%02X:%02X:%02X:%02X",
rle.mac[0], rle.mac[1], rle.mac[2], rle.mac[3], rle.mac[4], rle.mac[5]);
FTPBounce;
FTPBounce = ftp_bounce_lookup_next(config->bounce_lookup, &ret))
{
- char buf[BUF_SIZE + 1] = {0};
+ char buf[BUF_SIZE + 1] = { '\0' };
FTPBounce->ip.ntop(buf, BUF_SIZE);
ProfileStats* Http2Module::get_profile() const
{ return &http2_profile; }
-THREAD_LOCAL PegCount Http2Module::peg_counts[PEG_COUNT__MAX] = { 0 };
+THREAD_LOCAL PegCount Http2Module::peg_counts[PEG_COUNT__MAX] = { };
bool Http2Module::begin(const char*, int, SnortConfig*)
{
ProfileStats* HttpModule::get_profile() const
{ return &http_profile; }
-THREAD_LOCAL PegCount HttpModule::peg_counts[PEG_COUNT_MAX] = { 0 };
+THREAD_LOCAL PegCount HttpModule::peg_counts[PEG_COUNT_MAX] = { };
bool HttpModule::begin(const char*, int, SnortConfig*)
{