From: Andrew Au Date: Tue, 5 Mar 2019 21:48:50 +0000 (-0800) Subject: Fix issue 23040 X-Git-Tag: accepted/tizen/unified/20190813.215958~61^2~31 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=ffcdabd7735d6860dec361d1efde20be4cf89b8f;p=platform%2Fupstream%2Fcoreclr.git Fix issue 23040 --- diff --git a/src/vm/eventpipebuffer.cpp b/src/vm/eventpipebuffer.cpp index c513df4..395725e 100644 --- a/src/vm/eventpipebuffer.cpp +++ b/src/vm/eventpipebuffer.cpp @@ -174,9 +174,17 @@ EventPipeEventInstance* EventPipeBuffer::GetNext(EventPipeEventInstance *pEvent, return NULL; } - // We have a pointer within the bounds of the buffer. - // Find the next event by skipping the current event with it's data payload immediately after the instance. - pNextInstance = (EventPipeEventInstance *)GetNextAlignedAddress(const_cast(pEvent->GetData() + pEvent->GetDataLength())); + if (pEvent->GetData()) + { + // We have a pointer within the bounds of the buffer. + // Find the next event by skipping the current event with it's data payload immediately after the instance. + pNextInstance = (EventPipeEventInstance *)GetNextAlignedAddress(const_cast(pEvent->GetData() + pEvent->GetDataLength())); + } + else + { + // In case we do not have a payload, the next instance is right after the current instance + pNextInstance = (EventPipeEventInstance*)GetNextAlignedAddress((BYTE*)(pEvent + 1)); + } // Check to see if we've reached the end of the written portion of the buffer. if((BYTE*)pNextInstance >= m_pCurrent)