Attention is currently required from: neels. pespin has posted comments on this change. ( https://gerrit.osmocom.org/c/libosmo-pfcp/+/29039 )
Change subject: gtlv: check memory bounds 1/3: encoding TLV ......................................................................
Patch Set 1: Code-Review+1
(3 comments)
File src/libosmo-gtlv/gtlv_dec_enc.c:
https://gerrit.osmocom.org/c/libosmo-pfcp/+/29039/comment/10eacd5c_e5fed231 PS1, Line 52: /* Reverse offsetof(): return the address of the struct member for a given osmo_gtlv_msg and member ofs_foo value. */ "ofs_foo" you mean memb_ofs here?
https://gerrit.osmocom.org/c/libosmo-pfcp/+/29039/comment/bea708fc_aa20fdf5 PS1, Line 55: const char *p = parent; this extra p = parent here is only making thing smore difficult to understand. Just use parent or pass const uint8_t *parent.
In any case s/char/uint8_t/ here, otherwise looks more like a string.
https://gerrit.osmocom.org/c/libosmo-pfcp/+/29039/comment/5c449a51_ea4c686c PS1, Line 390: int osmo_gtlvs_encode(struct osmo_gtlv_put *gtlv, const void *decoded_struct, size_t decoded_struct_max_len, "max_len" afaict can be simply named "size", since it's the size of the decoded struct?