aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThierry Vignaud <tv@mageia.org>2012-12-03 02:20:35 +0000
committerThierry Vignaud <tv@mageia.org>2012-12-03 02:20:35 +0000
commitdf8e76366d77c877391c667b811d720568c768f6 (patch)
treee0f693d12fdaa9f1d5a30a763cce9bdcc8181fce
parent0c7a3cdf3e37b2855e16364c10e6c7d1f8b69a64 (diff)
downloadperl-URPM-df8e76366d77c877391c667b811d720568c768f6.tar
perl-URPM-df8e76366d77c877391c667b811d720568c768f6.tar.gz
perl-URPM-df8e76366d77c877391c667b811d720568c768f6.tar.bz2
perl-URPM-df8e76366d77c877391c667b811d720568c768f6.tar.xz
perl-URPM-df8e76366d77c877391c667b811d720568c768f6.zip
(Db_traverse_tag_find) fix a rare segfault
found accidently could be triggered by the following (calling enough times either requires() or provides() while traversing rpm db) which resulting in an "Invalid read of size 8": use URPM; my $db = URPM::DB::open()->traverse_tag_find('whatprovides', 'kernel', sub { my ($p) = @_; warn $p->requires, $p->requires, $p->requires, $p->requires, $p->requires, $p->requires, $p->requires, $p->requires, $p->requires, $p->requires, $p->requires, $p->requires, $p->requires, $p->requires, $p->requires, $p->requires, $p->requires; return 1; }); bug introduced in commit r4947 on June 14 2012: "(_run_cb_while_traversing) introduce this helper"
-rw-r--r--NEWS2
-rw-r--r--URPM.xs2
2 files changed, 4 insertions, 0 deletions
diff --git a/NEWS b/NEWS
index c7d4425..95291f5 100644
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,5 @@
+- fix a rare segfault
+
Version 4.19 - 2 December 2012
- kill pkg->disttag (unused, introduced for rpm5 prior to the fork)
diff --git a/URPM.xs b/URPM.xs
index b5579ae..4391c68 100644
--- a/URPM.xs
+++ b/URPM.xs
@@ -2435,8 +2435,10 @@ Db_traverse_tag_find(db,tag,name,callback)
ovsflags = ts_nosignature(db->ts);
mi = rpmtsInitIterator(db->ts, rpmtag, name, 0);
while ((header = rpmdbNextIterator(mi))) {
+ dSP;
int count = _run_cb_while_traversing(callback, header, 0);
+ SPAGAIN;
if (count == 1 && POPi) {
found = 1;
break;