From 21d596193d12ff0f1f00c59910a8b1bfd1887110 Mon Sep 17 00:00:00 2001 From: Silvan Calarco Date: Thu, 1 Oct 2020 11:39:53 +0200 Subject: [PATCH] reports.c: increase size of obsoletebuf from 4096 to 8192 --- src/reports.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/reports.c b/src/reports.c index 77d9b69..83c45be 100644 --- a/src/reports.c +++ b/src/reports.c @@ -1782,13 +1782,15 @@ int print_contentslist(struct configTag *ct, int arch) { return 0; } +#define OBSOLETEBUF_SIZE 8096 + int print_datatables(struct configTag *ct, int arch) { FILE *fbd,*fd,*fv,*fb,*fbsh,*fs,*fw; char builddeps_filename[PATH_MAX], deps_filename[PATH_MAX], virtual_filename[PATH_MAX], builds_filename[PATH_MAX], builds_sh_filename[PATH_MAX], sources_filename[PATH_MAX], warnings_filename[PATH_MAX]; - char obsoletebuf[PATH_MAX]; + char obsoletebuf[OBSOLETEBUF_SIZE]; struct headerList *currheaderlist, *currchild; struct headerSourceList *currheadersourcelist, *oldheadersourcelist; struct rebuildList *currrebuild; @@ -2052,9 +2054,9 @@ int print_datatables(struct configTag *ct, int arch) { if (currchild) { if (!strncmp(currheadersourcelist->arch, "noarch", PATH_MAX)) - snprintf(obsoletebuf, PATH_MAX, "noarch"); + snprintf(obsoletebuf, OBSOLETEBUF_SIZE, "noarch"); else - snprintf(obsoletebuf, PATH_MAX, "%s", ct->arch[arch]); + snprintf(obsoletebuf, OBSOLETEBUF_SIZE, "%s", ct->arch[arch]); fprintf(fbsh,"[ \"$pkg\" = \"%s\" ] && { pkg_header=(%s %s %s %s \"%s\" \"%s\" %ld %ld %d %s); ", currheadersourcelist->name, currheadersourcelist->name, @@ -2081,9 +2083,9 @@ int print_datatables(struct configTag *ct, int arch) { } for (i = 0; i < currchild->obsoletecount; i++ ) { if ((i > 0) && (!strcmp(currchild->obsoletename[i],currchild->obsoletename[i-1]))) continue; - if (strlen(obsoletebuf) + strlen(currchild->obsoletename[i]) >= PATH_MAX - 2) { + if (strlen(obsoletebuf) + strlen(currchild->obsoletename[i]) >= OBSOLETEBUF_SIZE - 2) { logmsg(LOG_WARNING, "%s: reached obsoletebuf maximum size (%d); skipping further obsoletes in output file", - currheadersourcelist->name, PATH_MAX); + currheadersourcelist->name, OBSOLETEBUF_SIZE); break; } if (obsoletebuf[0] != '\0') strncat(obsoletebuf, " ", sizeof(obsoletebuf) - strlen(obsoletebuf));