Fix some errors found by oss-fuzz (#1834)

This commit is contained in:
Ivan Nardi
2022-12-20 22:50:18 +01:00
committed by GitHub
parent fa67166fcc
commit 22821241e2
2 changed files with 4 additions and 4 deletions
+2 -2
View File
@@ -635,8 +635,8 @@ ndpi_timer_sub(const pkt_timeval *a,
const pkt_timeval *b,
pkt_timeval *result)
{
result->tv_sec = a->tv_sec - b->tv_sec;
result->tv_usec = a->tv_usec - b->tv_usec;
result->tv_sec = (unsigned long long)a->tv_sec - (unsigned long long)b->tv_sec;
result->tv_usec = (unsigned long long)a->tv_usec - (unsigned long long)b->tv_usec;
if(result->tv_usec < 0) {
--result->tv_sec;
result->tv_usec += 1000000;
+2 -2
View File
@@ -2352,7 +2352,7 @@ static u_int8_t ndpi_check_hostname_risk_exception(struct ndpi_detection_module_
if(automa->ac_automa) {
AC_TEXT_t ac_input_text;
AC_REP_t match;
AC_REP_t match = {0};
ac_input_text.astring = hostname, ac_input_text.length = strlen(hostname);
ac_input_text.option = 0;
@@ -2657,7 +2657,7 @@ u_int8_t is_a_common_alpn(struct ndpi_detection_module_struct *ndpi_str,
if(automa->ac_automa) {
AC_TEXT_t ac_input_text;
AC_REP_t match;
AC_REP_t match = {0};
ac_input_text.astring = (char*)alpn_to_check, ac_input_text.length = alpn_to_check_len;
ac_input_text.option = 0;