uapi: skip peers with invalid keys

This commit is contained in:
Jason A. Donenfeld
2019-08-05 16:57:41 +02:00
parent b4010123f7
commit 4e3018a967
2 changed files with 16 additions and 4 deletions

View File

@@ -243,7 +243,12 @@ func (device *Device) IpcSetOperation(socket *bufio.Reader) *IPCError {
logError.Println("Failed to create new peer:", err)
return &IPCError{ipc.IpcErrorInvalid}
}
logDebug.Println(peer, "- UAPI: Created")
if peer == nil {
dummy = true
peer = &Peer{}
} else {
logDebug.Println(peer, "- UAPI: Created")
}
}
case "remove":