openvpn icon indicating copy to clipboard operation
openvpn copied to clipboard

Fix argv leaks in delete_route() and delete_route_ipv6()

Open cacamille3 opened this issue 4 years ago • 3 comments

If a route structure is passed to delete_route() or delete_route_ipv6() without the RT_DEFINED or RT_ADDED flags set, both functions leak an "argv" structure allocation

Thank you for your contribution

You are welcome to open PR, but they are used for discussion only. All patches must eventually go to the openvpn-devel mailing list for review:

  • https://lists.sourceforge.net/lists/listinfo/openvpn-devel

Please send your patch using git-send-email. For example to send your latest commit to the list:

$ git send-email [email protected] HEAD~1

For details, see these Wiki articles:

  • https://community.openvpn.net/openvpn/wiki/DeveloperDocumentation
  • https://community.openvpn.net/openvpn/wiki/Contributing

cacamille3 avatar Oct 05 '21 16:10 cacamille3

this has been fixed in master and release/2.5 3 months ago...

commit 5e88f131b55af96782532f3d1e086de4e17260fe Author: David Korczynski [email protected] Date: Wed Jul 14 17:25:33 2021 +0100

Fix argv leaks in add_route() and add_route_ipv6()

cron2 avatar Oct 05 '21 16:10 cron2

@cacamille3 I just discussed with @cron2 and we figured that your patch is indeed valid. As explained in the automatic PR message, can you please send your patch to our mailing list for review?

Thanks!

p.s. don't forget your signed-off-by line!

ordex avatar Oct 05 '21 16:10 ordex

@cacamille3 as another suggestion, can you please move the declaration and initialization of argv just above gc_init() please? this way we allocate the argv only when needed. (We do similarly in other functions)

ordex avatar Oct 05 '21 16:10 ordex

Hey @cacamille3 ! Was this path sent to the mailing list after addressing the suggestions? I am not sure I have seen it or not.

ordex avatar Sep 17 '22 14:09 ordex

I took the freedom to reimplement the single patch and send it to the ml. This PR can be closed. Thanks!

ordex avatar Sep 17 '22 22:09 ordex

Strange.... Yes as far as I remember I sent it to the mailing list.

cacamille3 avatar Sep 20 '22 09:09 cacamille3