Skip to content

Add debug testing options and bug fixes#86

Merged
jgowdy-godaddy merged 1 commit intomainfrom
debug-testing
Mar 6, 2026
Merged

Add debug testing options and bug fixes#86
jgowdy-godaddy merged 1 commit intomainfrom
debug-testing

Conversation

@jgowdy-godaddy
Copy link
Contributor

Summary

  • Bug fixes: Fix race condition in Setup() using CompareAndSwap, fix panic-on-panic in exported functions (return ERR_PANIC instead), fix SetEnv error handling, fix EstimateBuffer base64 calculation, close DB connection on Shutdown(), add missing error log in Decrypt
  • Debug features: Add DisableZeroCopy option to defensively copy FFI input buffers, add NullDataCheck option to detect all-null input data before/after encryption
  • cobhan-go v0.5.0: Use cobhan.CopyBuffers() for zero-copy control and cobhan.IsBufferAllNulls()/cobhan.BufferLength() for null data checks at the FFI edge

Test plan

  • All existing tests pass
  • TestEncryptDecryptRoundTripWithDefensiveCopy validates the defensive copy path
  • Manual testing with NullDataCheck enabled to verify logging behavior

🤖 Generated with Claude Code

Use cobhan.CopyBuffers() for defensive copy instead of manual
copy in encryptData. Move null data checks to Encrypt/EncryptToJson
edge using cobhan.IsBufferAllNulls() and cobhan.BufferLength().
Remove local isBufferAllNull and disableZeroCopy atomic.
@jgowdy-godaddy jgowdy-godaddy merged commit fc7e61d into main Mar 6, 2026
4 checks passed
@jgowdy-godaddy jgowdy-godaddy deleted the debug-testing branch March 6, 2026 18:33
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.

2 participants