Fix some warnings and two errors found while fuzzing (#1844)

Fix CI
See: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=54614
This commit is contained in:
Ivan Nardi
2023-01-03 13:21:54 +01:00
committed by GitHub
parent cb15d2b328
commit 9c83f0f3c5
3 changed files with 21 additions and 3 deletions
+6
View File
@@ -538,6 +538,12 @@ void ndpi_set_proto_defaults(struct ndpi_detection_module_struct *ndpi_str,
}
name = ndpi_strdup(protoName);
if(!name) {
#ifdef DEBUG
NDPI_LOG_ERR(ndpi_str, "[NDPI] %s/protoId=%d: mem allocation error\n", protoName, protoId);
#endif
return;
}
if(ndpi_str->proto_defaults[protoId].protoName)
ndpi_free(ndpi_str->proto_defaults[protoId].protoName);