whisper.cpp/bindings/ruby/test
OrbisAI Security b3877e10c0
fix: in bindings/ruby/test/jfk_reader/jfk_reader in jfk_reader.c (#3756)
* fix: V-002 security vulnerability

Automated security fix generated by Orbis Security AI

* fix(ruby): use Ruby allocator macros in jfk_reader and fix memory leak

- Replace calloc/free with ALLOC_N/xfree to match Ruby binding conventions
  (ALLOC_N handles overflow checking and raises NoMemoryError on failure)
- Free temporary samples buffer after conversion loop (was leaked)
- Add NULL check for fopen return value with rb_raise
- Add comment clarifying n_samples is a compile-time constant

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* fix(ruby): return false instead of rb_raise in memory_view callback

rb_memory_view_get_func_t callbacks should communicate errors via
return value (false), not exceptions. rb_memory_view_get has no
exception-handling wrapper around get_func calls.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* replacing ALLOC_N with rb_protect as ALLOC_N raises Ruby exceptions

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-05-25 08:19:23 +02:00
..
jfk_reader fix: in bindings/ruby/test/jfk_reader/jfk_reader in jfk_reader.c (#3756) 2026-05-25 08:19:23 +02:00
helper.rb
test_callback.rb
test_context_params.rb ruby : add `Whisper::Context::Params`, fix token memory management (#3647) 2026-02-04 20:33:09 +09:00
test_error.rb
test_model.rb
test_package.rb ruby : transcribe without GVL, accept more MemoryViews, Windows support, fix memory size report, improve document (#3775) 2026-05-07 06:28:18 +02:00
test_params.rb ruby : fix dangling pointers, memory leak, and SEGV on parallel transcription (#3715) 2026-03-22 02:03:00 +09:00
test_segment.rb
test_token.rb ruby : add `Whisper::Context::Params`, fix token memory management (#3647) 2026-02-04 20:33:09 +09:00
test_vad.rb
test_vad_context.rb ruby : add `VAD::Context#segments_from_samples`, allow Pathname, etc. (#3633) 2026-01-30 22:59:36 +09:00
test_vad_params.rb
test_vad_segment.rb
test_vad_segments.rb
test_whisper.rb ruby : fix dangling pointers, memory leak, and SEGV on parallel transcription (#3715) 2026-03-22 02:03:00 +09:00