Skip to content

Commit

Permalink
Merge pull request #117 from pzeinlinger/master
Browse files Browse the repository at this point in the history
Updates memcall dependency
  • Loading branch information
awnumar committed Aug 11, 2019
2 parents e8bd095 + 9c56ac8 commit 7f22065
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 12 deletions.
1 change: 1 addition & 0 deletions AUTHORS
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ Carlo Alberto Ferraris <cafxx@strayorange.com>
dotcppfile <dotcppfile@gmail.com>
Joseph Richey <joerichey@google.com>
Neven Sajko <nsajko@gmail.com>
Paul Zeinlinger <paul.zeinlinger@gmail.com>
10 changes: 5 additions & 5 deletions core/buffer.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,10 +81,10 @@ func NewBuffer(size int) (*Buffer, error) {
Copy(b.postguard, b.canary)

// Make the guard pages inaccessible.
if err := memcall.Protect(b.preguard, memcall.NoAccess); err != nil {
if err := memcall.Protect(b.preguard, memcall.NoAccess()); err != nil {
Panic(err)
}
if err := memcall.Protect(b.postguard, memcall.NoAccess); err != nil {
if err := memcall.Protect(b.postguard, memcall.NoAccess()); err != nil {
Panic(err)
}

Expand Down Expand Up @@ -118,7 +118,7 @@ func (b *Buffer) Freeze() {
// Only do anything if currently mutable.
if b.mutable {
// Make the memory immutable.
if err := memcall.Protect(b.inner, memcall.ReadOnly); err != nil {
if err := memcall.Protect(b.inner, memcall.ReadOnly()); err != nil {
Panic(err)
}
b.mutable = false
Expand All @@ -139,7 +139,7 @@ func (b *Buffer) Melt() {
// Only do anything if currently immutable.
if !b.mutable {
// Make the memory mutable.
if err := memcall.Protect(b.inner, memcall.ReadWrite); err != nil {
if err := memcall.Protect(b.inner, memcall.ReadWrite()); err != nil {
Panic(err)
}
b.mutable = true
Expand All @@ -162,7 +162,7 @@ func (b *Buffer) Destroy() {
}

// Make all of the memory readable and writable.
if err := memcall.Protect(b.memory, memcall.ReadWrite); err != nil {
if err := memcall.Protect(b.memory, memcall.ReadWrite()); err != nil {
Panic(err)
}

Expand Down
2 changes: 1 addition & 1 deletion core/exit.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ func Panic(v interface{}) {
// Wipe all of the currently active LockedBuffers.
for _, b := range buffers.list {
if !b.mutable {
memcall.Protect(b.inner, memcall.ReadWrite)
memcall.Protect(b.inner, memcall.ReadWrite())
}
Wipe(b.Data())
}
Expand Down
3 changes: 1 addition & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ module github.com/awnumar/memguard
go 1.12

require (
github.com/awnumar/memcall v0.0.0-20190801095353-58a204f562ae
github.com/awnumar/memcall v0.0.0-20190808153224-92b5aac61e68
golang.org/x/crypto v0.0.0-20190701094942-4def268fd1a4
golang.org/x/sys v0.0.0-20190804053845-51ab0e2deafa // indirect
)
6 changes: 2 additions & 4 deletions go.sum
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
github.com/awnumar/memcall v0.0.0-20190801095353-58a204f562ae h1:ck6GMKuDNv9reL5fxbkHmD5FV49LrIQbkHxJy0Wb2aI=
github.com/awnumar/memcall v0.0.0-20190801095353-58a204f562ae/go.mod h1:3aPn9FogSgkIpmqdURz6CCsdJTe7TVz48mcny6j7j4Y=
github.com/awnumar/memcall v0.0.0-20190808153224-92b5aac61e68 h1:sqUhQxqaZ/noGr8vdR6OaM2/zpVzBvXbQvCwaMfQ92k=
github.com/awnumar/memcall v0.0.0-20190808153224-92b5aac61e68/go.mod h1:sbEXyqNZZ3Cebk+6zOUmFNN8OuHHlugjiUmqn2tfiiM=
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
golang.org/x/crypto v0.0.0-20190701094942-4def268fd1a4 h1:HuIa8hRrWRSrqYzx1qI49NNxhdi2PrY7gxVSq1JjLDc=
golang.org/x/crypto v0.0.0-20190701094942-4def268fd1a4/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190801041406-cbf593c0f2f3 h1:4y9KwBHBgBNwDbtu44R5o1fdOCQUEXhbk/P4A9WmJq0=
golang.org/x/sys v0.0.0-20190801041406-cbf593c0f2f3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190804053845-51ab0e2deafa h1:KIDDMLT1O0Nr7TSxp8xM5tJcdn8tgyAONntO829og1M=
golang.org/x/sys v0.0.0-20190804053845-51ab0e2deafa/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=

0 comments on commit 7f22065

Please sign in to comment.