-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Fix heap-buffer overflow in FPREncodePerfSessions #8872
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
@paulb777 Is it possible to enable Address Sanitizer when running tests in CI so that we can catch these issues early? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems like a definite improvement. It's problematic to calloc a zero length array. :)
Where does the session_verbosity array expand and how is the memory expanded.
Does this even need to be dynamic memory if there is only ever one element in it?
See the code in build.sh that Firestore uses for running sanitizers. It should be adaptable for Performance |
Coverage ReportAffected SDKs
Test Logs
|
The changes look good to me here. But, we might want to do the static analyzer checks as well as a part of this PR to make sure we catch these issues ahead of time. |
Good questions! For now, the session_verbosity has just 1 element. But overtime, we would have more elements there. |
Thanks for the explanation @jeremyjiang-dev . If the array could expand in the future, then doesn't |
I agree that the code would need to be rewritten anyway. Without knowing what might be added to the |
@paulb777 I'm not sure of your suggestion here. The current proto field for the Can you qualify what I'm missing here? |
Maybe I'm missing something but doesn't the line |
Ha, get it now. Unfortunately this array would have to be hard coded to 1 because of how the proto is defined. The array will expand based on the number of allowed verbosity qualifiers. For now, this would be hardcoded to just 1. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM on green CI.
Maybe the failing sanitizer checks should be deferred to another PR?
Thanks Paul! I will add sanitizer checks in another PR. |
Fix #8849.