Skip to content

Commit df8cada

Browse files
committed
transaction: Properly handle nil bytes in binary transactions
If returned binaries are nil, we should pass them as nil and not as an empty bytes array.
1 parent d099649 commit df8cada

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

transaction.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,8 @@ func cbPAMConv(s C.int, msg *C.char, c C.uintptr_t) (*C.char, C.int) {
188188
bytes, err := cb.RespondPAMBinary(BinaryPointer(msg))
189189
if err != nil {
190190
return nil, ConvAgain.toC()
191+
} else if bytes == nil {
192+
return nil, Success.toC()
191193
}
192194
return (*C.char)(C.CBytes(bytes)), Success.toC()
193195
} else {

0 commit comments

Comments
 (0)