From: Andrew Au Date: Fri, 17 May 2019 21:29:00 +0000 (-0700) Subject: Allow the write when the buffer can fit the event exactly X-Git-Tag: submit/tizen/20210909.063632~11030^2~1498 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=23ae9a4f6eb1713692815b589ea949f32fb217b7;p=platform%2Fupstream%2Fdotnet%2Fruntime.git Allow the write when the buffer can fit the event exactly Commit migrated from https://github.com/dotnet/coreclr/commit/4d4d411dceb28c89bcd61b1fe41b5fb7a2af896b --- diff --git a/src/coreclr/src/vm/eventpipebuffer.cpp b/src/coreclr/src/vm/eventpipebuffer.cpp index 091e87e..6d453b1 100644 --- a/src/coreclr/src/vm/eventpipebuffer.cpp +++ b/src/coreclr/src/vm/eventpipebuffer.cpp @@ -74,7 +74,7 @@ bool EventPipeBuffer::WriteEvent(Thread *pThread, EventPipeSession &session, Eve unsigned int eventSize = sizeof(EventPipeEventInstance) + payload.GetSize(); // Make sure we have enough space to write the event. - if(m_pCurrent + eventSize >= m_pLimit) + if(m_pCurrent + eventSize > m_pLimit) { return false; } diff --git a/src/coreclr/src/vm/eventpipebuffer.h b/src/coreclr/src/vm/eventpipebuffer.h index fc0fa62..3e6bb7a 100644 --- a/src/coreclr/src/vm/eventpipebuffer.h +++ b/src/coreclr/src/vm/eventpipebuffer.h @@ -118,7 +118,7 @@ private: FORCEINLINE BYTE* GetNextAlignedAddress(BYTE *pAddress) { LIMITED_METHOD_CONTRACT; - _ASSERTE(m_pBuffer <= pAddress && m_pLimit > pAddress); + _ASSERTE(m_pBuffer <= pAddress && pAddress <= m_pLimit); pAddress = (BYTE*)ALIGN_UP(pAddress, AlignmentSize);