fuzz: improvements (#2400)
Create the zip file with all the traces only once. Add a new fuzzer to test "shoco" compression algorithm
This commit is contained in:
@@ -67,10 +67,7 @@
|
||||
/* **************************************************** */
|
||||
|
||||
static u_int16_t ndpi_community_id_buf_copy(u_int8_t * const dst, const void * const src, u_int16_t len) {
|
||||
if(src)
|
||||
memcpy(dst, src, len);
|
||||
else
|
||||
memset(dst, 0, len);
|
||||
memcpy(dst, src, len);
|
||||
|
||||
return len;
|
||||
}
|
||||
|
||||
@@ -143,15 +143,6 @@ u_int32_t ndpi_domain_classify_add_domains(struct ndpi_detection_module_struct *
|
||||
|
||||
/* ********************************************************** */
|
||||
|
||||
bool ndpi_domain_classify_finalize(ndpi_domain_classify *s) {
|
||||
if(!s)
|
||||
return(false);
|
||||
|
||||
return(true);
|
||||
}
|
||||
|
||||
/* ********************************************************** */
|
||||
|
||||
bool ndpi_domain_classify_hostname(struct ndpi_detection_module_struct *ndpi_mod,
|
||||
ndpi_domain_classify *s,
|
||||
u_int16_t *class_id /* out */,
|
||||
|
||||
@@ -7981,7 +7981,6 @@ int ndpi_enable_loaded_categories(struct ndpi_detection_module_struct *ndpi_str)
|
||||
}
|
||||
#else
|
||||
ndpi_domain_classify_free(ndpi_str->custom_categories.sc_hostnames);
|
||||
// ndpi_domain_classify_finalize(ndpi_str->custom_categories.sc_hostnames_shadow);
|
||||
ndpi_str->custom_categories.sc_hostnames = ndpi_str->custom_categories.sc_hostnames_shadow;
|
||||
ndpi_str->custom_categories.sc_hostnames_shadow = ndpi_domain_classify_alloc();
|
||||
#endif
|
||||
|
||||
@@ -2302,6 +2302,9 @@ int ndpi_hash_find_entry(ndpi_str_hash *h, char *key, u_int key_len, u_int16_t *
|
||||
ndpi_str_hash_priv *h_priv = (ndpi_str_hash_priv *)h;
|
||||
ndpi_str_hash_priv *item;
|
||||
|
||||
if(!key || key_len == 0)
|
||||
return(2);
|
||||
|
||||
HASH_FIND(hh, h_priv, key, key_len, item);
|
||||
|
||||
if (item != NULL) {
|
||||
@@ -2319,6 +2322,9 @@ int ndpi_hash_add_entry(ndpi_str_hash **h, char *key, u_int8_t key_len, u_int16_
|
||||
ndpi_str_hash_priv *h_priv = (ndpi_str_hash_priv *)*h;
|
||||
ndpi_str_hash_priv *item;
|
||||
|
||||
if(!key || key_len == 0)
|
||||
return(3);
|
||||
|
||||
HASH_FIND(hh, h_priv, key, key_len, item);
|
||||
|
||||
if(item != NULL) {
|
||||
|
||||
Reference in New Issue
Block a user