Re: [PATCH uci] uci: decrease the n_section when section is freed

2023-09-14 Thread Jan Venekamp
On 14/09/2023 23:36, Leon Busch-George wrote: > Before finding and applying Jeff's patch I had written a small test > application that creates a few random sections in the 'dhcp' UCI > package and deletes them again (uci_set). > Afterwards, it iterates all packages (uci_list_configs), prints a line

Re: [PATCH uci] uci: decrease the n_section when section is freed

2023-09-14 Thread Leon Busch-George
Hi Jan, On Thu, 7 Sep 2023 18:12:56 +0200 Jan Venekamp wrote: > Could you provided a example / test case for this behaviour? Before finding and applying Jeff's patch I had written a small test application that creates a few random sections in the 'dhcp' UCI package and deletes them again (uc

Re: [PATCH uci] uci: decrease the n_section when section is freed

2023-09-07 Thread Jan Venekamp
When working on 16e8a3b1 [1] I looked at anonymous sections and uci_fixup_section too. It seemed rather hairy to me, but I decided then to leave it as is. > The package n_section counter increases when a section is allocated > but does not decrease when a section is freed. I suspect this is by de

Re: [PATCH uci] uci: decrease the n_section when section is freed

2023-09-03 Thread Leon Busch-George
No idea whether this fix is entirely correct but I also encountered the issue and the patch fixes them. When a large enough number of sections is deleted, it is also possible to go out of bounds leading to segmentation faults. On Tue, 29 Aug 2023 19:58:46 +0800 Jeff Shiu wrote: > The package n_

[PATCH uci] uci: decrease the n_section when section is freed

2023-08-29 Thread Jeff Shiu
The package n_section counter increases when a section is allocated but does not decrease when a section is freed. Since the anonymous section name is comprised of the section counter, if the package is not reloaded, an incorrect count will result in operating on the wrong section. Signed-off-by: