aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThierry Vignaud <tv@mandriva.org>2006-11-29 15:36:27 +0000
committerThierry Vignaud <tv@mandriva.org>2006-11-29 15:36:27 +0000
commit8a3c7b3be201f1faf0f2dcd3d9882018c9425261 (patch)
treea16ab2087e2a64211e30a3bfe810cd384128dc5d
parent4ee19d4705bd5ef81c0cd1b9681cfca913bae90f (diff)
downloadperl-URPM-8a3c7b3be201f1faf0f2dcd3d9882018c9425261.tar
perl-URPM-8a3c7b3be201f1faf0f2dcd3d9882018c9425261.tar.gz
perl-URPM-8a3c7b3be201f1faf0f2dcd3d9882018c9425261.tar.bz2
perl-URPM-8a3c7b3be201f1faf0f2dcd3d9882018c9425261.tar.xz
perl-URPM-8a3c7b3be201f1faf0f2dcd3d9882018c9425261.zip
(Trans_add) fix the segfault when using --excludepath (introduced in
r32435:32440). however, using --excludepath will still segfaults, but later, in rpmtsAddInstallElement() ...
-rw-r--r--URPM.xs11
1 files changed, 5 insertions, 6 deletions
diff --git a/URPM.xs b/URPM.xs
index d0f6405..8286e08 100644
--- a/URPM.xs
+++ b/URPM.xs
@@ -2669,7 +2669,11 @@ Trans_add(trans, pkg, ...)
CODE:
if ((pkg->flag & FLAG_ID) <= FLAG_ID_MAX && pkg->h != NULL) {
int update = 0;
+#ifdef RPM_446
+ rpmRelocation relocations = NULL;
+#else
rpmRelocation *relocations = NULL;
+#endif
/* compability mode with older interface of add */
if (items == 3) {
update = SvIV(ST(2));
@@ -2689,19 +2693,14 @@ Trans_add(trans, pkg, ...)
while (--j >= 0) {
SV **e = av_fetch(excludepath, j, 0);
if (e != NULL && *e != NULL) {
-#ifdef RPM_446
- rpmRelocation relptr = relocations[j];
- relptr->oldPath = SvPV_nolen(*e);
-#else
relocations[j].oldPath = SvPV_nolen(*e);
-#endif
}
}
}
}
}
}
- RETVAL = rpmtsAddInstallElement(trans->ts, pkg->h, (fnpyKey)(1+(pkg->flag & FLAG_ID)), update, *relocations) == 0;
+ RETVAL = rpmtsAddInstallElement(trans->ts, pkg->h, (fnpyKey)(1+(pkg->flag & FLAG_ID)), update, relocations) == 0;
/* free allocated memory, check rpm is copying it just above, at least in 4.0.4 */
free(relocations);
} else RETVAL = 0;