Skip to content

Fix LoggingEventSource to handle null strings#2957

Merged
sywhang merged 3 commits into
dotnet:masterfrom
sywhang:dev/suwhang/fix-logging-event-source
Mar 10, 2020
Merged

Fix LoggingEventSource to handle null strings#2957
sywhang merged 3 commits into
dotnet:masterfrom
sywhang:dev/suwhang/fix-logging-event-source

Conversation

@sywhang

@sywhang sywhang commented Feb 12, 2020

Copy link
Copy Markdown

Fix issue initially reported in this issue: microsoft/perfview#1092.

EventSource.WriteEventCore does not play nicely with null strings passed directly.

This fixes #2958.

cc @davidfowl @josalem

@davidfowl

Copy link
Copy Markdown
Member

We should file a bug here

@sywhang

sywhang commented Feb 12, 2020

Copy link
Copy Markdown
Author

Filed #2958

@davidfowl

Copy link
Copy Markdown
Member

Do we have any tests for this?

@sywhang

sywhang commented Feb 12, 2020

Copy link
Copy Markdown
Author

I can add some with this PR.

@davidfowl

Copy link
Copy Markdown
Member

Can we make this change in one place SetEventData? Just do value ?? “”

@josalem

josalem commented Feb 12, 2020

Copy link
Copy Markdown

You would need to make the swap before you fix the char* I think, so it might require a refactor of how SetEventData is used. The char* needs to be fixed until WriteEventCore returns.

@sywhang sywhang requested a review from davidfowl March 3, 2020 22:56
@davidfowl

Copy link
Copy Markdown
Member

I got a pretty sweet hack for this

@tommcdon tommcdon added this to the 5.0.0 milestone Mar 10, 2020
@sywhang sywhang merged commit 8d0fa05 into dotnet:master Mar 10, 2020
maryamariyan pushed a commit to maryamariyan/runtime that referenced this pull request Mar 11, 2020
…x-logging-event-source

Fix LoggingEventSource to handle null strings


Commit migrated from dotnet/extensions@8d0fa05
maryamariyan pushed a commit to maryamariyan/runtime that referenced this pull request Mar 27, 2020
…x-logging-event-source

Fix LoggingEventSource to handle null strings


Commit migrated from dotnet/extensions@8d0fa05
maryamariyan pushed a commit to maryamariyan/runtime that referenced this pull request Mar 27, 2020
…x-logging-event-source

Fix LoggingEventSource to handle null strings


Commit migrated from dotnet/extensions@8d0fa05
JunTaoLuo pushed a commit to dotnet/aspnetcore that referenced this pull request Nov 17, 2020
…x-logging-event-source

Fix LoggingEventSource to handle null strings\n\nCommit migrated from dotnet/extensions@8d0fa05
@ghost ghost locked as resolved and limited conversation to collaborators May 26, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

LoggingEventSource can create wrong event payloads

5 participants