From 9de2b407d7034b81963f8c5663233d353356d6cc Mon Sep 17 00:00:00 2001 From: Kazuki Yamaguchi Date: Wed, 11 Dec 2024 00:59:37 +0900 Subject: [PATCH] [ruby/openssl] digest: make output buffer String independent in #finish Likewise, OpenSSL::Digest#finish needs to make the output buffer independent before writing to it. https://github.com/ruby/openssl/commit/9cc8a83466 --- ext/openssl/ossl_digest.c | 1 + 1 file changed, 1 insertion(+) diff --git a/ext/openssl/ossl_digest.c b/ext/openssl/ossl_digest.c index 029d9d7f36..eb39c2a972 100644 --- a/ext/openssl/ossl_digest.c +++ b/ext/openssl/ossl_digest.c @@ -259,6 +259,7 @@ ossl_digest_finish(int argc, VALUE *argv, VALUE self) str = rb_str_new(NULL, out_len); } else { StringValue(str); + rb_str_modify(str); rb_str_resize(str, out_len); }