Skip to content

Commit

Permalink
digest: make output buffer String independent in #finish
Browse files Browse the repository at this point in the history
Likewise, OpenSSL::Digest#finish needs to make the output buffer
independent before writing to it.
  • Loading branch information
rhenium committed Dec 10, 2024
1 parent 1de3b80 commit 9cc8a83
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions ext/openssl/ossl_digest.c
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,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);
}

Expand Down

0 comments on commit 9cc8a83

Please sign in to comment.