]> git.djapps.eu Git - pkg/ggml/sources/whisper.cpp/commit
fix: in bindings/ruby/test/jfk_reader/jfk_reader in jfk_reader.c (#3756)
authorOrbisAI Security <redacted>
Mon, 25 May 2026 06:19:23 +0000 (11:49 +0530)
committerGitHub <redacted>
Mon, 25 May 2026 06:19:23 +0000 (08:19 +0200)
commitb3877e10c0a8435c53209b2ebfbaa8359f7baaae
tree0925efb932d7cd549b9a2a374fc413158fbc2aa5
parent0ccd896f5b882628e1c077f9769735ef4ce52860
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 <redacted>
* 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 <redacted>
* replacing ALLOC_N with rb_protect as ALLOC_N raises Ruby exceptions

---------

Co-authored-by: Claude Opus 4.6 <redacted>
bindings/ruby/test/jfk_reader/jfk_reader.c