reports.c: generateHTML_SRPMSFiles: fix a segfault when writing multiple providers
This commit is contained in:
parent
374df0a529
commit
160acba232
@ -1165,49 +1165,50 @@ generateHTML_SRPMSFiles(struct configTag *configtag)
|
|||||||
/* list build requirements */
|
/* list build requirements */
|
||||||
fprintf(fout, "<tr><td nowrap>Build requirements:</td><td><font size=\"-1\">");
|
fprintf(fout, "<tr><td nowrap>Build requirements:</td><td><font size=\"-1\">");
|
||||||
|
|
||||||
for (i = 0; i < currheadersourcelist->requirecount; i++) {
|
for (i = 0; i < currheadersourcelist->requirecount; i++) {
|
||||||
if (currheadersourcelist->require[i]->resolved) {
|
if (currheadersourcelist->require[i]->resolved) {
|
||||||
if (currheadersourcelist->require[i]->resolved->numbuildproviders == 0) {
|
if (currheadersourcelist->require[i]->resolved->numbuildproviders == 0) {
|
||||||
// missing provider
|
// missing provider
|
||||||
fprintf(fout,"<b>%s(unresolved)</b>",currheadersourcelist->require[i]->resolved->name);
|
fprintf(fout,"<b>%s(unresolved)</b>",currheadersourcelist->require[i]->resolved->name);
|
||||||
} else if (currheadersourcelist->require[i]->resolved->numbuildproviders == 1) {
|
} else if (currheadersourcelist->require[i]->resolved->numbuildproviders == 1) {
|
||||||
// single provider
|
// single provider
|
||||||
if ((i == 0 ||
|
if ((i == 0 ||
|
||||||
strcmp(currheadersourcelist->require[i-1]->name,
|
strcmp(currheadersourcelist->require[i-1]->name,
|
||||||
currheadersourcelist->require[i]->name)) &&
|
currheadersourcelist->require[i]->name)) &&
|
||||||
strcmp(currheadersourcelist->name,
|
strcmp(currheadersourcelist->name,
|
||||||
currheadersourcelist->require[i]->name)) {
|
currheadersourcelist->require[i]->name)) {
|
||||||
fprintf(fout,"<a href=\"%stag=%s&pkg=%s.%s\">%s</a>",
|
fprintf(fout,"<a href=\"%stag=%s&pkg=%s.%s\">%s</a>",
|
||||||
configtag->configdefaults->url_prefix,
|
configtag->configdefaults->url_prefix,
|
||||||
configtag->repository[currheadersourcelist->require[i]->resolved->buildprovider[0]->altrepository]->tag,
|
configtag->repository[currheadersourcelist->require[i]->resolved->buildprovider[0]->altrepository]->tag,
|
||||||
currheadersourcelist->require[i]->resolved->name,
|
currheadersourcelist->require[i]->resolved->name,
|
||||||
configtag->arch[0],
|
configtag->arch[0],
|
||||||
currheadersourcelist->require[i]->resolved->name);
|
currheadersourcelist->require[i]->resolved->name);
|
||||||
if ((configtag->repository_level > 0) &&
|
if ((configtag->repository_level > 0) &&
|
||||||
currheadersourcelist->require[i]->resolved->buildprovider[0]->sourceheader &&
|
currheadersourcelist->require[i]->resolved->buildprovider[0]->sourceheader &&
|
||||||
(currheadersourcelist->require[i]->resolved->buildprovider[0]->altrepository == configtag->repository_level)) {
|
(currheadersourcelist->require[i]->resolved->buildprovider[0]->altrepository == configtag->repository_level)) {
|
||||||
snprintf(buffer, PATH_MAX, "has build requirement %s which is only provided in this repository",
|
snprintf(buffer, PATH_MAX, "has build requirement %s which is only provided in this repository",
|
||||||
currheadersourcelist->require[i]->resolved->name);
|
currheadersourcelist->require[i]->resolved->name);
|
||||||
addWarning(currheadersourcelist, buffer);
|
addWarning(currheadersourcelist, buffer);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// multiple providers
|
// multiple providers
|
||||||
if (i == 0 ||
|
if (i == 0 ||
|
||||||
strcmp(currheadersourcelist->require[i-1]->resolved->name,
|
!currheadersourcelist->require[i-1]->resolved ||
|
||||||
currheadersourcelist->require[i]->resolved->name))
|
strcmp(currheadersourcelist->require[i-1]->resolved->name,
|
||||||
fprintf(fout,"<i>%s</i>(",currheadersourcelist->require[i]->resolved->name);
|
currheadersourcelist->require[i]->resolved->name))
|
||||||
for (j = 0; j < currheadersourcelist->require[i]->resolved->numbuildproviders; j++) {
|
fprintf(fout,"<i>%s</i>(",currheadersourcelist->require[i]->resolved->name);
|
||||||
fprintf(fout,"<a href=\"%stag=%s&pkg=%s.%s\">%s</a>",
|
for (j = 0; j < currheadersourcelist->require[i]->resolved->numbuildproviders; j++) {
|
||||||
configtag->configdefaults->url_prefix,
|
fprintf(fout,"<a href=\"%stag=%s&pkg=%s.%s\">%s</a>",
|
||||||
configtag->repository[currheadersourcelist->require[i]->resolved->buildprovider[j]->altrepository]->tag,
|
configtag->configdefaults->url_prefix,
|
||||||
currheadersourcelist->require[i]->resolved->buildprovider[j]->name,
|
configtag->repository[currheadersourcelist->require[i]->resolved->buildprovider[j]->altrepository]->tag,
|
||||||
configtag->arch[0],
|
currheadersourcelist->require[i]->resolved->buildprovider[j]->name,
|
||||||
currheadersourcelist->require[i]->resolved->buildprovider[j]->name);
|
configtag->arch[0],
|
||||||
if (j+1 < currheadersourcelist->require[i]->resolved->numbuildproviders) fprintf(fout,"|");
|
currheadersourcelist->require[i]->resolved->buildprovider[j]->name);
|
||||||
}
|
if (j+1 < currheadersourcelist->require[i]->resolved->numbuildproviders) fprintf(fout,"|");
|
||||||
fprintf(fout,")");
|
}
|
||||||
} // if numproviders
|
fprintf(fout,")");
|
||||||
|
} // if numproviders
|
||||||
if (currheadersourcelist->require[i]->flags & (RPMSENSE_LESS|RPMSENSE_GREATER|RPMSENSE_EQUAL)) {
|
if (currheadersourcelist->require[i]->flags & (RPMSENSE_LESS|RPMSENSE_GREATER|RPMSENSE_EQUAL)) {
|
||||||
fprintf(fout,"[");
|
fprintf(fout,"[");
|
||||||
if (currheadersourcelist->require[i]->flags & RPMSENSE_LESS) fprintf(fout, "<");
|
if (currheadersourcelist->require[i]->flags & RPMSENSE_LESS) fprintf(fout, "<");
|
||||||
|
Loading…
Reference in New Issue
Block a user