summaryrefslogtreecommitdiff
path: root/backport-Use-unsigned-integers-more-consistently-in-the-handl.patch
blob: 4127e882718a7f5e77c09004961e70f381e640e2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
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