diff options
author | Nardi Ivan <nardi.ivan@gmail.com> | 2020-04-15 18:07:24 +0200 |
---|---|---|
committer | Nardi Ivan <nardi.ivan@gmail.com> | 2020-04-20 16:53:39 +0200 |
commit | b1a6c6b8957b62ec8ada423abfdcfa5471c00147 (patch) | |
tree | 0d03df67b8fa0647050a74f473985301a027fa79 /src/lib/protocols/tls.c | |
parent | e60354996737df132ef4a2a681839e1bf403c296 (diff) |
Fix some compilation warnings
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'; |