From 731629ff2296573c9a4f953183892b6dde4ac732 Mon Sep 17 00:00:00 2001 From: Thierry Vignaud Date: Wed, 29 Nov 2006 22:21:06 +0000 Subject: (Trans_add) fix segfault on ia32 (when one replace "struct foobar" by "foobar*", he should expect sizeof() to *slightly* differ in results) --- URPM.xs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/URPM.xs b/URPM.xs index aac72eb..5e650a4 100644 --- a/URPM.xs +++ b/URPM.xs @@ -2689,7 +2689,11 @@ Trans_add(trans, pkg, ...) if (SvROK(ST(i+1)) && SvTYPE(SvRV(ST(i+1))) == SVt_PVAV) { AV *excludepath = (AV*)SvRV(ST(i+1)); I32 j = 1 + av_len(excludepath); +#ifdef RPM_446 + relocations = calloc(j + 2, sizeof(*relocations)); +#else relocations = calloc(2 + av_len(excludepath), sizeof(rpmRelocation)); +#endif while (--j >= 0) { SV **e = av_fetch(excludepath, j, 0); relocations[j].newPath = NULL; -- cgit v1.2.1