]> git.ozlabs.org Git - petitboot/blobdiff - discover/kboot-parser.c
Fix seg fault with bare kboot.conf variables
[petitboot] / discover / kboot-parser.c
index e688c22d512fde7bf91736ba7808f38fd52f3c4c..429ae096ddccc0573056052243e80faaf85de2e4 100644 (file)
@@ -21,6 +21,11 @@ static void kboot_process_pair(struct conf_context *conf, const char *name,
        const char *root;
        struct boot_option *opt;
 
+       /* fixup for bare values */
+
+       if (!name)
+               return;
+
        if (conf_param_in_list(ignored_names, name))
                return;
 
@@ -133,10 +138,11 @@ static int kboot_parse(struct discover_context *dc)
        conf = talloc_zero(dc, struct conf_context);
 
        if (!conf)
-               return -1;
+               return 0;
 
        conf->dc = dc;
        conf->global_options = kboot_global_options,
+       conf_init_global_options(conf);
        conf->conf_files = kboot_conf_files,
        conf->process_pair = kboot_process_pair;
        conf->parser_info = (void *)kboot_ignored_names,