From a7bcffd9c619e3d2c79ea136b628f5a436b87ec1 Mon Sep 17 00:00:00 2001 From: John Johansen Date: Thu, 14 Jan 2016 17:26:26 -0800 Subject: [PATCH] Fix: segfault when processing directories BugLink: http://bugs.launchpad.net/bugs/1534405 Patch -r 2952 switched over to using the library kernel interface, and added a kernel_interface parameter to the dir_cb struct, that is used to process directories. Unfortunately kernel_interface parameter of the dir_cb struct is not being properly initialized resulting in odd failures and sefaults when the parser is processing directories. Signed-off-by: John Johansen Acked-by: Seth Arnold Acked-by: Steve Beattie --- parser/parser_main.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/parser/parser_main.c b/parser/parser_main.c index f67187620..dbf353d28 100644 --- a/parser/parser_main.c +++ b/parser/parser_main.c @@ -1141,8 +1141,10 @@ int main(int argc, char *argv[]) void *data); struct dir_cb_data cb_data; + memset(&cb_data, 0, sizeof(struct dir_cb_data)); cb_data.dirname = profilename; cb_data.cachedir = cacheloc; + cb_data.kernel_interface = kernel_interface; cb = binary_input ? binary_dir_cb : profile_dir_cb; if ((retval = dirat_for_each(AT_FDCWD, profilename, &cb_data, cb))) {