diff options
author | Alexis La Goutte <alexis.lagoutte@gmail.com> | 2016-05-24 13:46:17 +0200 |
---|---|---|
committer | Alexis La Goutte <alexis.lagoutte@gmail.com> | 2016-05-24 13:46:17 +0200 |
commit | bae6a09a7c200d216cdfea526fb9460cc070dbd6 (patch) | |
tree | 2f9124f189e0f03554f1f70c04110f4eb923837f /src/lib/ndpi_main.c | |
parent | 9935cb0e3ba59db43cdc3707f6b5b8718daa4249 (diff) |
ndpi_main(.c): fix Null pointer passed as an argument to a 'nonnull' parameter
Diffstat (limited to 'src/lib/ndpi_main.c')
-rw-r--r-- | src/lib/ndpi_main.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/lib/ndpi_main.c b/src/lib/ndpi_main.c index db1543807..2e2ac21ef 100644 --- a/src/lib/ndpi_main.c +++ b/src/lib/ndpi_main.c @@ -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); |