aboutsummaryrefslogtreecommitdiff
path: root/src/lib/ndpi_domains.c
diff options
context:
space:
mode:
authorIvan Nardi <12729895+IvanNardi@users.noreply.github.com>2024-01-24 21:16:58 +0100
committerGitHub <noreply@github.com>2024-01-24 21:16:58 +0100
commitd577508727226d44a713f1af38b08769546edd2a (patch)
treeb04fe77e9665778b1737099c815dd0ebba12777a /src/lib/ndpi_domains.c
parent7a83a8dc9122a730a74e5ac644413ae87f94e563 (diff)
fuzz: extend fuzzing coverage (#2281)
Diffstat (limited to 'src/lib/ndpi_domains.c')
-rw-r--r--src/lib/ndpi_domains.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/lib/ndpi_domains.c b/src/lib/ndpi_domains.c
index aeb34b010..ff7fd52cb 100644
--- a/src/lib/ndpi_domains.c
+++ b/src/lib/ndpi_domains.c
@@ -82,6 +82,8 @@ int ndpi_load_domain_suffixes(struct ndpi_detection_module_struct *ndpi_str,
const char* ndpi_get_host_domain_suffix(struct ndpi_detection_module_struct *ndpi_str,
const char *hostname) {
+ if(!ndpi_str)
+ return NULL;
if(ndpi_str->public_domain_suffixes == NULL)
return(hostname);
else {
@@ -96,6 +98,8 @@ const char* ndpi_get_host_domain_suffix(struct ndpi_detection_module_struct *ndp
const char* ndpi_get_host_domain(struct ndpi_detection_module_struct *ndpi_str,
const char *hostname) {
+ if(!ndpi_str)
+ return NULL;
if(ndpi_str->public_domain_suffixes == NULL)
return(hostname);
else {