Skip to content

Fix version metadata loading fallback and bounds - #3320

Merged
Widthdom merged 2 commits into
mainfrom
fix-issue3244-3025
Jun 6, 2026
Merged

Fix version metadata loading fallback and bounds#3320
Widthdom merged 2 commits into
mainfrom
fix-issue3244-3025

Conversation

@Widthdom

@Widthdom Widthdom commented Jun 6, 2026

Copy link
Copy Markdown
Owner

Summary

  • Make ConsoleUi.LoadVersion fail softly when version.json is missing, unreadable, malformed, or schema-invalid.
  • Bound version.json reads to 16 KiB and parse with an explicit JSON depth limit.
  • Add focused ConsoleUi regression coverage for malformed, missing, oversized, too-deep, and non-string version metadata.

Validation

  • dotnet build
  • dotnet test tests/CodeIndex.Tests/CodeIndex.Tests.csproj --filter "FullyQualifiedName~ConsoleUiTests.LoadVersionFromFile|FullyQualifiedName~ConsoleUiTests.LoadVersion_ReturnsActualVersion"
  • dotnet run --project tools/CodeIndex.Changelog -- check
  • dotnet format CodeIndex.sln --verify-no-changes
  • dotnet ./src/CodeIndex/bin/Debug/net8.0/cdidx.dll status --check --json
  • codex exec --ignore-user-config review --base origin/main --ephemeral

Documentation / Changelog

  • Added changelog.d/unreleased/3025.fixed.md.
  • Added changelog.d/unreleased/3244.fixed.md.
  • No README or guide update was needed because the change only hardens internal version metadata loading behavior.

Follow-up Candidates

  • None.

Fixes #3025
Fixes #3244

@Widthdom
Widthdom marked this pull request as ready for review June 6, 2026 06:11
@Widthdom
Widthdom marked this pull request as draft June 6, 2026 06:37
@Widthdom
Widthdom marked this pull request as ready for review June 6, 2026 06:40
@Widthdom
Widthdom merged commit bc96211 into main Jun 6, 2026
10 checks passed
@Widthdom
Widthdom deleted the fix-issue3244-3025 branch June 6, 2026 18:20
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.

version.json loading should use bounded reads and fail softly ConsoleUi version loading should tolerate malformed or oversized version.json

1 participant