misc: updated gatt library to fix an invalid memory access bug

This commit is contained in:
evilsocket 2019-04-18 10:56:10 +02:00
commit 1a6faa9f66
No known key found for this signature in database
GPG key ID: 1564D7F30393A456
2 changed files with 9 additions and 6 deletions

4
Gopkg.lock generated
View file

@ -27,7 +27,7 @@
[[projects]]
branch = "master"
digest = "1:881bb9d751b9408f038b83e9331ce3c57603710f3546f16e7d43b5c24e974f6d"
digest = "1:67f303802ce14d56880d9f2142adc00511441f0fcf7b7fd4ad5856e234963f15"
name = "github.com/bettercap/gatt"
packages = [
".",
@ -40,7 +40,7 @@
"xpc",
]
pruneopts = "UT"
revision = "d1a17475747afe7c0d78813596d4e95801a5d592"
revision = "fac16c0ad797bbccae1fe4acf49761b98f7516e7"
[[projects]]
branch = "master"

View file

@ -359,10 +359,13 @@ func (h *HCI) handleConnection(b []byte) {
return
}
h.plistmu.Lock()
pd := h.plist[ep.PeerAddress]
h.plistmu.Unlock()
pd.Conn = c
h.AcceptSlaveHandler(pd)
if pd := h.plist[ep.PeerAddress]; pd != nil {
h.plistmu.Unlock()
pd.Conn = c
h.AcceptSlaveHandler(pd)
} else {
log.Printf("HCI: can't find data for %v", ep.PeerAddress)
}
}
func (h *HCI) handleDisconnectionComplete(b []byte) error {