Skip to content

Commit

Permalink
transaction: Properly handle nil bytes in binary transactions
Browse files Browse the repository at this point in the history
If returned binaries are nil, we should pass them as nil and not as an
empty bytes array.
  • Loading branch information
3v1n0 committed Oct 12, 2023
1 parent beeb5ff commit 0bdfc69
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions transaction.go
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,8 @@ func cbPAMConv(s C.int, msg *C.char, c C.uintptr_t) (*C.char, C.int) {
bytes, err := cb.RespondPAMBinary(BinaryPointer(msg))
if err != nil {
return nil, ConvAgain.toC()
} else if bytes == nil {
return nil, Success.toC()
}
return (*C.char)(C.CBytes(bytes)), Success.toC()
} else {
Expand Down

0 comments on commit 0bdfc69

Please sign in to comment.