On 1/21/25 14:57, Frode Nordahl wrote:
> The use of ofpbuf_use_data() would allow someone to change the
> code to modify the buffer, which consequently would lead to memory
> allocations. Since there are no ofpbuf_uninit() calls in place
> that might invite a future bug.
>
> Let's make use of ofpbuf_use_const() instead.
>
> Fixes: 91fc51106cfe ("route-table: Support parsing multipath routes.")
> Signed-off-by: Frode Nordahl <[email protected]>
> ---
> lib/route-table.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/lib/route-table.c b/lib/route-table.c
> index 7168ecf9e..d9b51931e 100644
> --- a/lib/route-table.c
> +++ b/lib/route-table.c
> @@ -430,7 +430,7 @@ route_table_parse__(struct ofpbuf *buf, size_t ofs,
> struct rtnexthop *mp_rtnh;
> struct ofpbuf mp_buf;
>
> - ofpbuf_use_data(&mp_buf, nla, nla->nla_len);
> + ofpbuf_use_const(&mp_buf, nla, nla->nla_len);
> mp_rtnh = ofpbuf_try_pull(&mp_buf, sizeof *mp_rtnh);
>
> if (!mp_rtnh) {
Thanks, Frode! I un-abbreviated a couple of words in the title :)
and applied to main and 3.5.
Best regards, Ilya Maximets.
_______________________________________________
dev mailing list
[email protected]
https://mail.openvswitch.org/mailman/listinfo/ovs-dev