summaryrefslogtreecommitdiff
path: root/usr.sbin/rpki-client/rsync.c
diff options
context:
space:
mode:
authorClaudio Jeker <claudio@cvs.openbsd.org>2021-12-22 09:35:15 +0000
committerClaudio Jeker <claudio@cvs.openbsd.org>2021-12-22 09:35:15 +0000
commitc31982451a6ea393d2c55b2788a5f8b8cdd8140c (patch)
tree8b7192667d64d81ac7ab10fdff4b8110b7983954 /usr.sbin/rpki-client/rsync.c
parent1e73134a0b51c54e19df0415b7cd20f6e9074e69 (diff)
Replace two questionable size_t types. For the repo id use a unsigned int
and for the roa maxlength use unsigned char (like the prefixlen in struct ip_addr). With input and OK job@
Diffstat (limited to 'usr.sbin/rpki-client/rsync.c')
-rw-r--r--usr.sbin/rpki-client/rsync.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/usr.sbin/rpki-client/rsync.c b/usr.sbin/rpki-client/rsync.c
index 14dbd26cc53..58d22764368 100644
--- a/usr.sbin/rpki-client/rsync.c
+++ b/usr.sbin/rpki-client/rsync.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: rsync.c,v 1.30 2021/11/03 14:59:37 claudio Exp $ */
+/* $OpenBSD: rsync.c,v 1.31 2021/12/22 09:35:14 claudio Exp $ */
/*
* Copyright (c) 2019 Kristaps Dzonsons <kristaps@bsd.lv>
*
@@ -42,9 +42,9 @@
* of which process maps to which request.
*/
struct rsyncproc {
- char *uri; /* uri of this rsync proc */
- size_t id; /* identity of request */
- pid_t pid; /* pid of process or 0 if unassociated */
+ char *uri; /* uri of this rsync proc */
+ unsigned int id; /* identity of request */
+ pid_t pid; /* pid of process or 0 if unassociated */
};
/*
@@ -182,7 +182,7 @@ proc_rsync(char *prog, char *bind_addr, int fd)
for (;;) {
char *uri = NULL, *dst = NULL;
- size_t id;
+ unsigned int id;
pid_t pid;
int st;
@@ -222,7 +222,8 @@ proc_rsync(char *prog, char *bind_addr, int fd)
}
b = io_new_buffer();
- io_simple_buffer(b, &ids[i].id, sizeof(size_t));
+ io_simple_buffer(b, &ids[i].id,
+ sizeof(ids[i].id));
io_simple_buffer(b, &ok, sizeof(ok));
io_close_buffer(&msgq, b);