Skip to content

Commit

Permalink
Fix AV in HttpTelemetry.WriteEvent (#99606)
Browse files Browse the repository at this point in the history
* Fix AV in HttpTelemetry.WriteEvent

* Move descrs into fixed scope
  • Loading branch information
MihaZupan committed Mar 12, 2024
1 parent 7878f4e commit a21df88
Showing 1 changed file with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -339,13 +339,13 @@ private unsafe void WriteEvent(int eventId, byte arg1, byte arg2, long arg3, str
arg5 ??= "";
arg7 ??= "";

const int NumEventDatas = 7;
EventData* descrs = stackalloc EventData[NumEventDatas];

fixed (char* arg4Ptr = arg4)
fixed (char* arg5Ptr = arg5)
fixed (char* arg7Ptr = arg7)
{
const int NumEventDatas = 7;
EventData* descrs = stackalloc EventData[NumEventDatas];

descrs[0] = new EventData
{
DataPointer = (IntPtr)(&arg1),
Expand Down Expand Up @@ -381,9 +381,9 @@ private unsafe void WriteEvent(int eventId, byte arg1, byte arg2, long arg3, str
DataPointer = (IntPtr)arg7Ptr,
Size = (arg7.Length + 1) * sizeof(char)
};
}

WriteEventCore(eventId, NumEventDatas, descrs);
WriteEventCore(eventId, NumEventDatas, descrs);
}
}
}
}

0 comments on commit a21df88

Please sign in to comment.