aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThierry Vignaud <thierry.vignaud@gmail.com>2021-12-02 15:51:59 +0100
committerThierry Vignaud <thierry.vignaud@gmail.com>2021-12-02 15:55:12 +0100
commit950d56e991d307b9b60bde8f51920bee3d1bc61c (patch)
treebf06cfc6b01eb1244b8c79900e2d4cba82431500
parent9af2828ac5884a55978b7d0acfcc3e485026beb5 (diff)
downloadperl-URPM-950d56e991d307b9b60bde8f51920bee3d1bc61c.tar
perl-URPM-950d56e991d307b9b60bde8f51920bee3d1bc61c.tar.gz
perl-URPM-950d56e991d307b9b60bde8f51920bee3d1bc61c.tar.bz2
perl-URPM-950d56e991d307b9b60bde8f51920bee3d1bc61c.tar.xz
perl-URPM-950d56e991d307b9b60bde8f51920bee3d1bc61c.zip
(Pkg_build_info) Increase static buffer size by 50%
Rationale: when generating synthesys, there's one new pkg whose provides were not emitted in synthesis because its provides would overflow the static buffer by 2 bytes: "buffer overflow: 131074 < 131072 for provides" Also log when the buffer would be too small instead of silently ignoring the issue. The offending package is golang-github-azure-sdk-devel which has 2707 provides which translates to a 131074 characters line in synthesys.
-rw-r--r--Changes2
-rw-r--r--URPM.xs4
2 files changed, 5 insertions, 1 deletions
diff --git a/Changes b/Changes
index f61181a..8e6c3e5 100644
--- a/Changes
+++ b/Changes
@@ -1,3 +1,5 @@
+- Bump static buffer size when generating synthesys
+
Version 5.125 - 23 October 2021
- Further prevent SRPM to conflicts with its own build deps with rpm-4.16+
diff --git a/URPM.xs b/URPM.xs
index 51d416c..543388d 100644
--- a/URPM.xs
+++ b/URPM.xs
@@ -2177,7 +2177,7 @@ Pkg_build_info(pkg, fileno, provides_files=NULL, recommends=0)
int recommends
CODE:
if (pkg->info) {
- char buff[65536*2];
+ char buff[65536*3];
UV size;
/* info line should be the last to be written */
@@ -2189,6 +2189,8 @@ Pkg_build_info(pkg, fileno, provides_files=NULL, recommends=0)
size += snprintf(buff+size, sizeof(buff)-size, "@%s\n", provides_files);
}
write_nocheck(fileno, buff, size);
+ } else {
+ fprintf(stderr, "buffer overflow: %d < %d for provides\n", size, sizeof(buff));
}
}
if (pkg->conflicts && *pkg->conflicts) {