fix(sql): bound dollar-quote recursion depth in obfuscator#1965
fix(sql): bound dollar-quote recursion depth in obfuscator#1965paullegranddc wants to merge 1 commit into
Conversation
📚 Documentation Check Results📦
|
Signed-off-by: paullegranddc <paul.legranddescloizeaux@datadoghq.com>
7e47461 to
07771bc
Compare
🔒 Cargo Deny Results📦
|
Clippy Allow Annotation ReportComparing clippy allow annotations between branches:
Summary by Rule
Annotation Counts by File
Annotation Stats by Crate
About This ReportThis report tracks Clippy allow annotations for specific rules, showing how they've changed in this PR. Decreasing the number of these annotations generally improves code quality. |
🎉 All green!❄️ No new flaky tests detected 🎯 Code Coverage (details) 🔗 Commit SHA: 07771bc | Docs | Datadog PR Page | Give us feedback! |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1965 +/- ##
==========================================
- Coverage 72.63% 72.58% -0.05%
==========================================
Files 448 448
Lines 73582 73626 +44
==========================================
- Hits 53444 53441 -3
- Misses 20138 20185 +47
🚀 New features to boost your workflow:
|
Artifact Size Benchmark Reportaarch64-alpine-linux-musl
aarch64-unknown-linux-gnu
libdatadog-x64-windows
libdatadog-x86-windows
x86_64-alpine-linux-musl
x86_64-unknown-linux-gnu
|
Motivation
obfuscate_sqlon inner dollar-quoted bodies with no depth limit.Description
MAX_DOLLAR_QUOTE_RECURSION_DEPTHand trackrecursion_depthinTokenizerto bound nested processing.obfuscate_sql_with_recursion_limit(...)which returns a safe placeholder ("?") when the depth limit is reached.obfuscate_sql(...)calls for dollar-quoted inner content with calls toobfuscate_sql_with_recursion_limit(..., recursion_depth + 1).Tokenizer::new(...)signature and test call sites and add a regression testtest_dollar_quoted_recursion_depth_is_boundedthat constructs deep nested dollar-quoted SQL and validates the obfuscator completes without crashing.Testing
cargo test -p libdd-trace-obfuscation test_dollar_quoted_recursion_depth_is_boundedand the test passed.cargo test -p libdd-trace-obfuscation dollar_quotedand the suite passed (9 passed; 0 failed).Codex Task