Skip to content
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

Merged
merged 6 commits into from
Jan 29, 2020

Conversation

Blikingor
Copy link
Contributor

Fix for #1191

@Blikingor Blikingor requested a review from a team as a code owner January 28, 2020 13:52

private final Map<String, Set<String>> classMethodsToTrace;

private boolean validateConfigString(String configString) {
for (String clazz : configString.split(";")) {
if (!clazz.trim().matches(CONFIG_FORMAT)) {
Copy link
Contributor

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 {
Copy link
Contributor

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?

Copy link
Contributor Author

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.

@tylerbenson tylerbenson added this to the 0.42.0 milestone Jan 29, 2020
@tylerbenson tylerbenson merged commit 8757ba0 into DataDog:master Jan 29, 2020
@tylerbenson
Copy link
Contributor

Thanks for your contribution!

@tylerbenson tylerbenson added the tag: community Community contribution label Jan 31, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
tag: community Community contribution
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants