Skip to content

Fix RecordCache::add crash with null record composition - #37

Merged
adamdickmeiss merged 1 commit into
masterfrom
record-cache-add-fix
Nov 13, 2026
Merged

adamdickmeiss merged 1 commit into
masterfrom
record-cache-add-fix

Conversation

@adamdickmeiss

Copy link
Copy Markdown
Contributor

Skip cloning when the record composition is null. Add test_cache to cover the public RecordCache API, including null compositions, add, lookup, clear, request copying, and size limits.

Skip cloning when the record composition is null. Add test_cache
to cover the public RecordCache API, including null compositions,
add, lookup, clear, request copying, and size limits.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

No active review issues were reported for the cache null-composition fix and its regression coverage.

No open issues 🎉

What changed in this PR

Fixes a crash in RecordCache::add when a record composition is null and adds regression coverage for the public cache API.

Changes:

  • Skip composition cloning when the pointer is null.
  • Add tests for null compositions, add/lookup/clear behavior, request copying, and size limits.
  • Register the new test program and ignore its generated executable.
File Description
src/​yaz-z-cache.cpp Guard composition cloning against null pointers.
src/​test_cache.cpp Add public RecordCache API regression tests.
src/​Makefile.am Register test_cache as a check program.
src/​.gitignore Ignore the generated test_cache executable.

Review effort: Balanced

@adamdickmeiss
adamdickmeiss merged commit c1502e1 into master Nov 13, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants