Merge pull request #1607 from arvidsaur/arvidsaur-patch-1

Fix always true condition, possible out-of-bounds
This commit is contained in:
Günter Obiltschnig 2017-02-22 22:41:59 +01:00 committed by GitHub
commit 25e32d38c5

View File

@ -234,7 +234,7 @@ std::string ICMPv4PacketImpl::errorDescription(unsigned char* buffer, int length
break;
case TIME_EXCEEDED_TYPE:
if (code >= TIME_TO_LIVE || code < TIME_EXCEEDED_UNKNOWN)
if (code >= TIME_TO_LIVE && code < TIME_EXCEEDED_UNKNOWN)
err << TIME_EXCEEDED_CODE[code];
else
err << TIME_EXCEEDED_CODE[TIME_EXCEEDED_UNKNOWN];