Skip to content

[1.0.0] Add a depth limit when decoding. - #17

Merged
ChadSikorra merged 4 commits into
mainfrom
update/add-depth-limit
Oct 17, 2026
Merged

ChadSikorra merged 4 commits into
mainfrom
update/add-depth-limit

Conversation

@ChadSikorra

Copy link
Copy Markdown
Contributor

This adds a depth limit when decoding so we don't infinitely recurse, since we can be decoding PDUs from many contexts from sources we potentially do not trust. This defaults it to 16, which is greater than what's needed by LDAP / SNMP (primary uses for this library). PHP can handle a depth far greater before it becomes too much. So this just stops it at a sane limit.

Also fixing the CS settings in this repo and aligning it with the LDAP library.

@codecov

codecov Bot commented Oct 17, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 94.00000% with 6 lines in your changes missing coverage. Please review.
✅ Project coverage is 96.99%. Comparing base (7ae0e39) to head (f968960).

Files with missing lines Patch % Lines
src/FreeDSx/Asn1/Encoder/BerEncoder.php 97.43% 2 Missing ⚠️
src/FreeDSx/Asn1/Type/AbstractStringType.php 0.00% 2 Missing ⚠️
src/FreeDSx/Asn1/Type/RelativeOidType.php 0.00% 2 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##               main      #17      +/-   ##
============================================
+ Coverage     96.80%   96.99%   +0.18%     
- Complexity      456      458       +2     
============================================
  Files            29       29              
  Lines          1313     1329      +16     
============================================
+ Hits           1271     1289      +18     
+ Misses           42       40       -2     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@ChadSikorra
ChadSikorra merged commit bb89093 into main Oct 17, 2026
21 of 22 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant