diff options
Diffstat (limited to 'src/lib/protocols/tls.c')
-rw-r--r-- | src/lib/protocols/tls.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/lib/protocols/tls.c b/src/lib/protocols/tls.c index 560e483ac..a6d7883ce 100644 --- a/src/lib/protocols/tls.c +++ b/src/lib/protocols/tls.c @@ -316,8 +316,10 @@ static void processCertificateElements(struct ndpi_detection_module_struct *ndpi i += 2; - if((len > sizeof(dNSName)-1) || (len == 0 /* Looks something went wrong */)) - break; /* String too long */ + /* The check "len > sizeof(dNSName) - 1" will be always false. If we add it, + the compiler is smart enough to detect it and throws a warning */ + if((len == 0 /* Looks something went wrong */)) + break; strncpy(dNSName, (const char*)&packet->payload[i], len); dNSName[len] = '\0'; |