You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It does not tell the caller how many bytes it actually used, which is problematic if you're reading from a stream.
We work around this by calling wally_psbt_to_bytes() again!
Also, looking through the implementation, I am not convinced that you don't read past the end of the buffer in various cases. The usual way of handling this is to have all your internal demarshal functions take a "unsigned char **cursor, size_t *max", rather than having explicit length checks.
This has the strong advantage that you can simply continue demarshaling even if you run over the end, and just do the checks at the end.
It does not tell the caller how many bytes it actually used, which is problematic if you're reading from a stream.
We work around this by calling wally_psbt_to_bytes() again!
Also, looking through the implementation, I am not convinced that you don't read past the end of the buffer in various cases. The usual way of handling this is to have all your internal demarshal functions take a "unsigned char **cursor, size_t *max", rather than having explicit length checks.
This has the strong advantage that you can simply continue demarshaling even if you run over the end, and just do the checks at the end.
See: https://github.com/ElementsProject/lightning/blob/master/wire/fromwire.c
The text was updated successfully, but these errors were encountered: