mirror of https://github.com/OISF/suricata
hyperscan: fix minor coverity warning 1358024
*** CID 1358024: Null pointer dereferences (REVERSE_INULL)
/src/util-mpm-hs.c: 1043 in SCHSPrintInfo()
1037 printf(" SCHSPattern %" PRIuMAX "\n", (uintmax_t)sizeof(SCHSPattern));
1038 printf("Unique Patterns: %" PRIu32 "\n", mpm_ctx->pattern_cnt);
1039 printf("Smallest: %" PRIu32 "\n", mpm_ctx->minlen);
1040 printf("Largest: %" PRIu32 "\n", mpm_ctx->maxlen);
1041 printf("\n");
1042
>>> CID 1358024: Null pointer dereferences (REVERSE_INULL)
>>> Null-checking "ctx" suggests that it may be null, but it has already been dereferenced on all paths leading to the check.
1043 if (ctx) {
1044 char *db_info = NULL;
1045 if (hs_database_info(pd->hs_db, &db_info) == HS_SUCCESS) {
1046 printf("HS Database Info: %s\n", db_info);
1047 SCFree(db_info);
1048 }
pull/1970/head
parent
070a35fd3b
commit
2ccf028eac
Loading…
Reference in New Issue