fuzz: extend fuzzing coverage

This commit is contained in:
Nardi Ivan
2023-10-07 13:34:37 +02:00
committed by Ivan Nardi
parent 8ca842edec
commit 86115a8a65
11 changed files with 245 additions and 42 deletions
+4
View File
@@ -2670,12 +2670,16 @@ void ndpi_debug_printf(unsigned int proto, struct ndpi_detection_module_struct *
ndpi_vsnprintf(str, sizeof(str) - 1, format, args);
va_end(args);
/* While fuzzing, we want to test log code, but we don't want to log anything! */
#ifndef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
if(ndpi_str != NULL || (file_name != NULL && func_name != NULL)) {
printf("%s:%s:%-3d - [%u]: %s", file_name, func_name, line_number, proto, str);
} else {
printf("Proto: %u, %s", proto, str);
}
#endif
#endif
}
/* ****************************************** */
+1 -1
View File
@@ -84,7 +84,7 @@ static void xorbytes3e( unsigned char *output, unsigned char *buf,
n -= LBLOCKSIZE;
}
while(n) {
*output++ = *input++ ^ *ectr++;
*output = *input++ ^ *ectr++;
*buf++ ^= *output++;
n--;
}