projects
/
tools
/
librpm-tizen.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
eae127b
)
Fix endless loop on RPMDBI_PACKAGES iteration when offset specified
author
Panu Matilainen
<pmatilai@redhat.com>
Tue, 22 Sep 2009 11:52:57 +0000
(14:52 +0300)
committer
Panu Matilainen
<pmatilai@redhat.com>
Tue, 22 Sep 2009 11:52:57 +0000
(14:52 +0300)
lib/rpmdb.c
patch
|
blob
|
history
diff --git
a/lib/rpmdb.c
b/lib/rpmdb.c
index
f15c446
..
f6028e1
100644
(file)
--- a/
lib/rpmdb.c
+++ b/
lib/rpmdb.c
@@
-2038,8
+2038,10
@@
top:
} while (mi->mi_offset == 0);
/* If next header is identical, return it now. */
- if (mi->mi_prevoffset && mi->mi_offset == mi->mi_prevoffset)
- return mi->mi_h;
+ if (mi->mi_prevoffset && mi->mi_offset == mi->mi_prevoffset) {
+ /* ...but rpmdb record numbers are unique, avoid endless loop */
+ return (mi->mi_rpmtag == RPMDBI_PACKAGES) ? NULL : mi->mi_h;
+ }
/* Retrieve next header blob for index iterator. */
if (uh == NULL) {