Re: [OpenWrt-Devel] [PATCH] uci: do not access invalid memory when updating an existing section

2018-08-13 Thread Enrico Mioso
Hello! First of all, thank you very very much for your patience and review. You are right, my patch introduces an unintended change in behaviour, and actually does not solve the problem. That day I didn't see this. However, I think it is still useful to report what happens here, even just for

Re: [OpenWrt-Devel] [PATCH] uci: do not access invalid memory when updating an existing section

2018-08-13 Thread Yousong Zhou
On Tue, 14 Aug 2018 at 04:56, Enrico Mioso wrote: > > Hello, and thank you for your help, and review. > I agree on not changing behaviour. the problem is not actually a memory leak, > but the fact that ptr->s->options seems to not be a valid pointer at that > point. > At least, this is what

Re: [OpenWrt-Devel] [PATCH] uci: do not access invalid memory when updating an existing section

2018-08-13 Thread Enrico Mioso
Hello, and thank you for your help, and review. I agree on not changing behaviour. the problem is not actually a memory leak, but the fact that ptr->s->options seems to not be a valid pointer at that point. At least, this is what valgrind suggested, if I am not wrong or interpreting wrongly the

Re: [OpenWrt-Devel] [PATCH] uci: do not access invalid memory when updating an existing section

2018-08-13 Thread Yousong Zhou
On Sun, 12 Aug 2018 at 14:41, Enrico Mioso wrote: > > If a new section with the same name and type of an old one is found, a > memory reallocation happens. Still, the options list for the section is > not reinitialized, hence a stale pointer is being used. > > Signed-off-by: Enrico Mioso > --- >

[OpenWrt-Devel] [PATCH] uci: do not access invalid memory when updating an existing section

2018-08-12 Thread Enrico Mioso
If a new section with the same name and type of an old one is found, a memory reallocation happens. Still, the options list for the section is not reinitialized, hence a stale pointer is being used. Signed-off-by: Enrico Mioso --- list.c | 1 + 1 file changed, 1 insertion(+) diff --git