-
Notifications
You must be signed in to change notification settings - Fork 277
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
Fix potential StackOverFlowError on regexp #1193
Conversation
|
||
private final Map<String, Set<String>> classMethodsToTrace; | ||
|
||
private boolean validateConfigString(String configString) { | ||
for (String clazz : configString.split(";")) { | ||
if (!clazz.trim().matches(CONFIG_FORMAT)) { |
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.
I don't think clazz
is the right variable name for this. Maybe segment
instead?
import datadog.trace.agent.test.utils.ConfigUtils | ||
import datadog.trace.instrumentation.trace_annotation.TraceConfigInstrumentation | ||
|
||
class TraceConfigInstrumentationTest extends AgentTestRunner { |
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.
I see you had a test but removed it? Any reason in particular?
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.
I wrote it to try to reproduce the StackOverflowError but realized it won't be so easy as stack size and memory for it will vary depending on JVM and environment. I had also overlooked the existing tests, there was an overlap and not much extra value so I decided to remove.
Thanks for your contribution! |
Fix for #1191