Avoid SIGSEGV in addOption() in loader/modules.c. Just because found does not equal 0 does not mean we found the module requested. --- loader/modules.c | 16 ++++++++++------ 1 files changed, 10 insertions(+), 6 deletions(-) diff --git a/loader/modules.c b/loader/modules.c index bddda2b..d5129b7 100644 --- a/loader/modules.c +++ b/loader/modules.c @@ -115,17 +115,21 @@ static void addOption(const char *module, const char *option) { found = 1; break; } - if (found == 0) { + + if (found) { + modopts[i].options = realloc(modopts[i].options, + sizeof(modopts[i].options) * + (modopts[i].numopts + 1)); + modopts[i].options[modopts[i].numopts - 1] = strdup(option); + modopts[i].options[modopts[i].numopts] = NULL; + } else { modopts = realloc(modopts, sizeof(*modopts) * (nummodopts + 1)); modopts[nummodopts].name = strdup(module); modopts[nummodopts].numopts = 1; modopts[nummodopts++].options = NULL; } - modopts[i].options = realloc(modopts[i].options, - sizeof(modopts[i].options) * - (modopts[i].numopts + 1)); - modopts[i].options[modopts[i].numopts - 1] = strdup(option); - modopts[i].options[modopts[i].numopts] = NULL; + + return; } static int isValidModule(char *module) { -- 1.6.2.5 _______________________________________________ Anaconda-devel-list mailing list Anaconda-devel-list@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/anaconda-devel-list