aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThierry Vignaud <tv@mandriva.org>2006-11-29 22:21:06 +0000
committerThierry Vignaud <tv@mandriva.org>2006-11-29 22:21:06 +0000
commit731629ff2296573c9a4f953183892b6dde4ac732 (patch)
treeb376f45cc86a566a1ba5ccbb6b18221de990b2b2
parent001783e1f3383ef2b17b3b94938c24cdec34df10 (diff)
downloadperl-URPM-731629ff2296573c9a4f953183892b6dde4ac732.tar
perl-URPM-731629ff2296573c9a4f953183892b6dde4ac732.tar.gz
perl-URPM-731629ff2296573c9a4f953183892b6dde4ac732.tar.bz2
perl-URPM-731629ff2296573c9a4f953183892b6dde4ac732.tar.xz
perl-URPM-731629ff2296573c9a4f953183892b6dde4ac732.zip
(Trans_add) fix segfault on ia32 (when one replace "struct foobar" by
"foobar*", he should expect sizeof() to *slightly* differ in results)
-rw-r--r--URPM.xs4
1 files changed, 4 insertions, 0 deletions
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;