mirage/ocaml-cstruct

Missing bounds checks for views and BE/LE

Closed this issue · 1 comments

avsm commented

See mirage/mirage-tcpip#56

The various Cstruct.LE/BE functions to do not check the validity of len of a local view, and only raise a bounds exception if the underlying Bigarray bounds are violated. We need to check the view length as well.

avsm commented

This may break existing code that worked accidentally due to not respecting the view length of Cstruct.sub results, so needs to be tested against existing users.