ndpi_main(.c): fix Null pointer passed as an argument to a 'nonnull' parameter

This commit is contained in:
Alexis La Goutte
2016-05-24 13:46:17 +02:00
parent 9935cb0e3b
commit bae6a09a7c
+5 -1
View File
@@ -550,7 +550,11 @@ static int ndpi_string_to_automa(struct ndpi_detection_module_struct *ndpi_struc
if(automa->ac_automa == NULL) return(-2);
ac_pattern.astring = value;
ac_pattern.rep.number = protocol_id;
ac_pattern.length = strlen(ac_pattern.astring);
if(value == NULL)
ac_pattern.length = 0;
else
ac_pattern.length = strlen(ac_pattern.astring);
ac_automata_add(((AC_AUTOMATA_t*)automa->ac_automa), &ac_pattern);
return(0);