rpm/rpm-4.14.2.1-fix-rebuilddb-from-rpm-5.2-better.patch

25 lines
907 B
Diff

diff -ru rpm-4.14.2.1.orig/lib/header.c rpm-4.14.2.1/lib/header.c
--- rpm-4.14.2.1.orig/lib/header.c 2018-09-13 14:52:36.935273631 +0200
+++ rpm-4.14.2.1/lib/header.c 2019-06-24 12:49:12.167065383 +0200
@@ -279,6 +279,8 @@
for (i = 0; i < il; i++) {
ei2h(&pe[i], &info);
+ if (info.tag == RPMTAG_FILESTATES && info.type == RPM_INT8_TYPE)
+ info.type = RPM_CHAR_TYPE;
/* Previous data must not overlap */
if (end > info.offset)
diff -ru rpm-4.14.2.1.orig/lib/rpmtd.c rpm-4.14.2.1/lib/rpmtd.c
--- rpm-4.14.2.1.orig/lib/rpmtd.c 2018-09-13 14:52:02.227221535 +0200
+++ rpm-4.14.2.1/lib/rpmtd.c 2019-06-22 17:24:56.186779146 +0200
@@ -151,7 +151,7 @@
{
char *res = NULL;
- if (td != NULL && td->type == RPM_CHAR_TYPE) {
+ if (td != NULL && (td->type == RPM_CHAR_TYPE || td->type == RPM_INT8_TYPE)) {
int ix = (td->ix >= 0 ? td->ix : 0);
res = (char *) td->data + ix;
}