Re: [Openvpn-devel] [PATCH] block-dns using iservice: fix a potential double free

2023-02-01 Thread Selva Nair
> > > Also I replaced 0x%x with %u in win_block_dns_service() for > consistency. You may want to do it in your patch too :) > We have at least another place where it's %x, so will leave that for another day. btw, shouldn't it be %d? Selva ___ Openvpn-de

Re: [Openvpn-devel] [PATCH] block-dns using iservice: fix a potential double free

2023-02-01 Thread Lev Stipakov
Hi, > Good point. I have a version that splits "add" and "delete" actions into > separate functions and does something like this. > > Please take a look here: > https://github.com/selvanair/openvpn/tree/block-dns-fix > The add and delete functions are in that order (with a forward declaration)

Re: [Openvpn-devel] [PATCH] block-dns using iservice: fix a potential double free

2023-02-01 Thread Selva Nair
Hi, On Wed, Feb 1, 2023 at 4:37 AM Lev Stipakov wrote: > Hi, > > I made a slightly different fix but then noticed your mail. > > Indeed the problem is that get/set_interface_metric fails, > and we call FwpmEngineClose0 after updating the undo list. When > openvpn process exits, we execute comman

Re: [Openvpn-devel] [PATCH] block-dns using iservice: fix a potential double free

2023-02-01 Thread Lev Stipakov
Hi, I made a slightly different fix but then noticed your mail. Indeed the problem is that get/set_interface_metric fails, and we call FwpmEngineClose0 after updating the undo list. When openvpn process exits, we execute commands in undo list, and second call to FwpmEngineClose0 causes Access Vio

[Openvpn-devel] [PATCH] block-dns using iservice: fix a potential double free

2023-01-31 Thread selva . nair
From: Selva Nair - An item added to undo-list was not removed on error, causing attempt to free again in Undo(). Also fix a memory leak possibility in the same context. Github: fixes OpenVPN/openvpn#232 Signed-off-by: Selva Nair --- src/openvpnserv/interactive.c | 17 ++--- 1