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.
This commit is contained in:
@@ -105,6 +105,9 @@ func cbPAMConv(s C.int, msg *C.char, c C.uintptr_t) (*C.char, C.int) {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, C.int(ErrConv)
|
return nil, C.int(ErrConv)
|
||||||
}
|
}
|
||||||
|
if bytes == nil {
|
||||||
|
return nil, success
|
||||||
|
}
|
||||||
return (*C.char)(C.CBytes(bytes)), success
|
return (*C.char)(C.CBytes(bytes)), success
|
||||||
}
|
}
|
||||||
handler = cb
|
handler = cb
|
||||||
|
|||||||
Reference in New Issue
Block a user