Fix buffer overflow in function ndpi_debug_printf()

This commit is contained in:
Vitaly Lavrov
2018-01-26 13:03:17 +03:00
parent 78feabfad7
commit 57fb117571
+2 -2
View File
@@ -1950,13 +1950,13 @@ void ndpi_debug_printf(unsigned int proto, struct ndpi_detection_module_struct *
{
#ifdef NDPI_ENABLE_DEBUG_MESSAGES
va_list args;
#define MAX_STR_LEN 120
#define MAX_STR_LEN 250
char str[MAX_STR_LEN];
if(ndpi_str != NULL && log_level > NDPI_LOG_ERROR &&
proto > 0 && proto < NDPI_MAX_SUPPORTED_PROTOCOLS &&
!NDPI_ISSET(&ndpi_str->debug_bitmask,proto)) return;
va_start(args, format);
vsprintf(str, format, args);
vsnprintf(str,sizeof(str)-1, format, args);
va_end(args);
if (ndpi_str != NULL) {