The program segfaults when doing an update, usually when update more than 10 files. Reproducible: Always Steps to Reproduce: 1. Execute the following snippet: for i in /etc/{,conf.d/,init.d/}; do for j in 1 2 3 4 5 6; do echo a > ${i}dgtest${j}; echo b > ${i}._cfg0000_dgtest${j}; done; done 2. Run conf-update 3. Select some files for updating 4. Hit [R]eplace Actual Results: Segmentation Fault Expected Results: The config files should have been replaced with updates Thanks to Vincent Huisman for reporting.
Created attachment 300907 [details, diff] Patch fixing leaks reported by valgrind
Every time I got the segfault, gdb reported SEGV in strdup, malloc and such functions, so I ran it through valgrind to figure out where things were going wrong. Turns out the main culprit was the order in which remove_menu freed the menu and corresponding items, which caused writes to free'd memory and caused problems with large enough menus. The above patch should fix that. I also fixed the remaining leaks I could find with the limited test case outlined in the report. The patch is 'verbose', the commented lines added in helpers.c chunk @@ -135,7 +139,7 @@ and in @@ -352,9 +363,9 @@ may be removed, I left them there purely to illustrate why the change was made.
+*conf-update-1.0.2 (17 Feb 2012) + + 17 Feb 2012; Sebastian Pipping <sping@gentoo.org> +conf-update-1.0.2.ebuild: + Fixes segfault (bug #402139, patch by Vincent Huisman), misc ebuild + improvements by Chema Alonso (nimiux) + Closing...