native: do proper error handling when deserializing user data

This commit is contained in:
Roman Khimov 2021-07-16 13:49:14 +03:00
parent fbe8bd2d9c
commit 4775b513f9

View file

@ -277,11 +277,13 @@ func (o *Oracle) FinishInternal(ic *interop.Context) error {
}),
})
r := io.NewBinReaderFromBuf(req.UserData)
userData := stackitem.DecodeBinary(r)
userData, err := stackitem.Deserialize(req.UserData)
if err != nil {
return err
}
args := []stackitem.Item{
stackitem.Make(req.URL),
stackitem.Make(userData),
userData,
stackitem.Make(resp.Code),
stackitem.Make(resp.Result),
}