Skip to content

Commit 9cc8a83

Browse files
committed
digest: make output buffer String independent in #finish
Likewise, OpenSSL::Digest#finish needs to make the output buffer independent before writing to it.
1 parent 1de3b80 commit 9cc8a83

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

ext/openssl/ossl_digest.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -232,6 +232,7 @@ ossl_digest_finish(int argc, VALUE *argv, VALUE self)
232232
str = rb_str_new(NULL, out_len);
233233
} else {
234234
StringValue(str);
235+
rb_str_modify(str);
235236
rb_str_resize(str, out_len);
236237
}
237238

0 commit comments

Comments
 (0)