Sodium::SecureBuffer Fix copying noaccess SecureBuffer's.
This commit is contained in:
parent
1e240f70b6
commit
f766db7e9e
1 changed files with 4 additions and 1 deletions
|
@ -49,7 +49,10 @@ module Sodium
|
|||
# For .dup
|
||||
def initialize(sbuf : self)
|
||||
initialize sbuf.bytesize
|
||||
sbuf.to_slice.copy_to self.to_slice
|
||||
# Maybe not thread safe
|
||||
sbuf.readonly do
|
||||
sbuf.to_slice.copy_to self.to_slice
|
||||
end
|
||||
readonly
|
||||
end
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue