summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2019-01-17 18:13:03 +0100
committerLukas Nykryn <lnykryn@redhat.com>2020-02-03 12:41:24 +0100
commit6ca588f3d62ad3391d558e34a7f002c0a88698b7 (patch)
tree222ea74aea93b6d561234fe77112237026fd60fb
parent3c1ccdf9a774de405ada5e4d46d3e844e66ea511 (diff)
downloadsystemd-6ca588f3d62ad3391d558e34a7f002c0a88698b7.tar.gz
sd-bus: make rqueue/wqueue sizes of type size_t
Let's do this like we usually do and size arrays with size_t. We already do this for the "allocated" counter correctly, and externally we expose the queue sizes as uint64_t anyway, hence there's really no point in usigned "unsigned" internally. (cherry picked from commit 143d4e045a798ccc87889b2a8a60d7fbe44be441) Related: CVE-2020-1712
-rw-r--r--src/libsystemd/sd-bus/bus-internal.h4
-rw-r--r--src/libsystemd/sd-bus/sd-bus.c2
2 files changed, 3 insertions, 3 deletions
diff --git a/src/libsystemd/sd-bus/bus-internal.h b/src/libsystemd/sd-bus/bus-internal.h
index 90e6028983..2d21319df5 100644
--- a/src/libsystemd/sd-bus/bus-internal.h
+++ b/src/libsystemd/sd-bus/bus-internal.h
@@ -221,11 +221,11 @@ struct sd_bus {
size_t rbuffer_size;
sd_bus_message **rqueue;
- unsigned rqueue_size;
+ size_t rqueue_size;
size_t rqueue_allocated;
sd_bus_message **wqueue;
- unsigned wqueue_size;
+ size_t wqueue_size;
size_t windex;
size_t wqueue_allocated;
diff --git a/src/libsystemd/sd-bus/sd-bus.c b/src/libsystemd/sd-bus/sd-bus.c
index 7f03528b89..f6719bdd80 100644
--- a/src/libsystemd/sd-bus/sd-bus.c
+++ b/src/libsystemd/sd-bus/sd-bus.c
@@ -2036,7 +2036,7 @@ _public_ int sd_bus_call(
_cleanup_(sd_bus_message_unrefp) sd_bus_message *m = sd_bus_message_ref(_m);
usec_t timeout;
uint64_t cookie;
- unsigned i;
+ size_t i;
int r;
bus_assert_return(m, -EINVAL, error);