From: Dan Moseley Date: Thu, 3 May 2018 00:20:50 +0000 (-0700) Subject: Clarifying comment on overflow (#17865) X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=9aea5b643d9f928244ddd50feaa6bc41fad28450;p=platform%2Fupstream%2Fcoreclr.git Clarifying comment on overflow (#17865) * Clarifying comment on overflow * Nits --- diff --git a/src/mscorlib/shared/System/Buffers/Utilities.cs b/src/mscorlib/shared/System/Buffers/Utilities.cs index 9e8a888bee..b675100b03 100644 --- a/src/mscorlib/shared/System/Buffers/Utilities.cs +++ b/src/mscorlib/shared/System/Buffers/Utilities.cs @@ -14,6 +14,9 @@ namespace System.Buffers { Debug.Assert(bufferSize >= 0); + // bufferSize of 0 will underflow here, causing a huge + // index which the caller will discard because it is not + // within the bounds of the bucket array. uint bitsRemaining = ((uint)bufferSize - 1) >> 4; int poolIndex = 0;