summaryrefslogtreecommitdiff
path: root/backport-Use-unsigned-integers-more-consistently-in-the-handl.patch
diff options
context:
space:
mode:
authorCoprDistGit <infra@openeuler.org>2024-09-18 07:05:42 +0000
committerCoprDistGit <infra@openeuler.org>2024-09-18 07:05:42 +0000
commit4ad1d692311b38472d44f5deb9c32634b334ed4d (patch)
tree3e004676c8e07b495fdeda7291033d0fde73d783 /backport-Use-unsigned-integers-more-consistently-in-the-handl.patch
parente248808867f90830a43b5ca5d192bef9dd2edec2 (diff)
automatic import of rpm
Diffstat (limited to 'backport-Use-unsigned-integers-more-consistently-in-the-handl.patch')
-rw-r--r--backport-Use-unsigned-integers-more-consistently-in-the-handl.patch66
1 files changed, 66 insertions, 0 deletions
diff --git a/backport-Use-unsigned-integers-more-consistently-in-the-handl.patch b/backport-Use-unsigned-integers-more-consistently-in-the-handl.patch
new file mode 100644
index 0000000..4127e88
--- /dev/null
+++ b/backport-Use-unsigned-integers-more-consistently-in-the-handl.patch
@@ -0,0 +1,66 @@
+From 8e6108a5964c7289f3db70f3d188293276416528 Mon Sep 17 00:00:00 2001
+From: Daniel Alley <dalley@redhat.com>
+Date: Thu, 8 Dec 2022 09:40:00 -0500
+Subject: [PATCH] Use unsigned integers more consistently in the handling of
+ tag data
+
+Conflict:NA
+Reference:https://github.com/rpm-software-management/rpm/commit/8e6108a5964c7289f3db70f3d188293276416528
+
+Not a functional change, it just makes the code more clear and
+self-consistent.
+---
+ lib/header.c | 16 ++++++++--------
+ 1 file changed, 8 insertions(+), 8 deletions(-)
+
+diff --git a/lib/header.c b/lib/header.c
+index 004102dd2..72fb3d4fe 100644
+--- a/lib/header.c
++++ b/lib/header.c
+@@ -568,7 +568,7 @@ static int regionSwab(indexEntry entry, int il, int dl,
+ }
+ } break;
+ case RPM_INT32_TYPE:
+- { int32_t * it = ie.data;
++ { uint32_t * it = ie.data;
+ for (; ie.info.count > 0; ie.info.count--, it += 1) {
+ if (dataEnd && ((unsigned char *)it) >= dataEnd)
+ return -1;
+@@ -576,7 +576,7 @@ static int regionSwab(indexEntry entry, int il, int dl,
+ }
+ } break;
+ case RPM_INT16_TYPE:
+- { int16_t * it = ie.data;
++ { uint16_t * it = ie.data;
+ for (; ie.info.count > 0; ie.info.count--, it += 1) {
+ if (dataEnd && ((unsigned char *)it) >= dataEnd)
+ return -1;
+@@ -772,9 +772,9 @@ static void * doExport(const struct indexEntry_s *hindex, int indexUsed,
+ count = entry->info.count;
+ src = entry->data;
+ while (count--) {
+- *((int32_t *)te) = htonl(*((int32_t *)src));
+- te += sizeof(int32_t);
+- src += sizeof(int32_t);
++ *((uint32_t *)te) = htonl(*((uint32_t *)src));
++ te += sizeof(uint32_t);
++ src += sizeof(uint32_t);
+ }
+ break;
+
+@@ -782,9 +782,9 @@ static void * doExport(const struct indexEntry_s *hindex, int indexUsed,
+ count = entry->info.count;
+ src = entry->data;
+ while (count--) {
+- *((int16_t *)te) = htons(*((int16_t *)src));
+- te += sizeof(int16_t);
+- src += sizeof(int16_t);
++ *((uint16_t *)te) = htons(*((uint16_t *)src));
++ te += sizeof(uint16_t);
++ src += sizeof(uint16_t);
+ }
+ break;
+
+--
+2.33.0
+