From d577508727226d44a713f1af38b08769546edd2a Mon Sep 17 00:00:00 2001 From: Ivan Nardi <12729895+IvanNardi@users.noreply.github.com> Date: Wed, 24 Jan 2024 21:16:58 +0100 Subject: fuzz: extend fuzzing coverage (#2281) --- src/lib/ndpi_domains.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/lib/ndpi_domains.c') 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 { -- cgit v1.2.3