Skip to content

Commit ffcdabd

Browse files
committed
Fix issue 23040
1 parent a20e3d0 commit ffcdabd

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

src/vm/eventpipebuffer.cpp

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -174,9 +174,17 @@ EventPipeEventInstance* EventPipeBuffer::GetNext(EventPipeEventInstance *pEvent,
174174
return NULL;
175175
}
176176

177-
// We have a pointer within the bounds of the buffer.
178-
// Find the next event by skipping the current event with it's data payload immediately after the instance.
179-
pNextInstance = (EventPipeEventInstance *)GetNextAlignedAddress(const_cast<BYTE *>(pEvent->GetData() + pEvent->GetDataLength()));
177+
if (pEvent->GetData())
178+
{
179+
// We have a pointer within the bounds of the buffer.
180+
// Find the next event by skipping the current event with it's data payload immediately after the instance.
181+
pNextInstance = (EventPipeEventInstance *)GetNextAlignedAddress(const_cast<BYTE *>(pEvent->GetData() + pEvent->GetDataLength()));
182+
}
183+
else
184+
{
185+
// In case we do not have a payload, the next instance is right after the current instance
186+
pNextInstance = (EventPipeEventInstance*)GetNextAlignedAddress((BYTE*)(pEvent + 1));
187+
}
180188

181189
// Check to see if we've reached the end of the written portion of the buffer.
182190
if((BYTE*)pNextInstance >= m_pCurrent)

0 commit comments

Comments
 (0)