From 4be9fb738746bad6f98c73252518a8709b90d331 Mon Sep 17 00:00:00 2001 From: Claudio Jeker Date: Tue, 12 Apr 2022 14:51:05 +0000 Subject: Do not convert the int value twice from little to host endian. io_read_int() already does the conversion so don't double up in io_read_ulong(). Fixes openrsync on sparc64. OK miod@ deraadt@ --- usr.bin/rsync/io.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'usr.bin/rsync') diff --git a/usr.bin/rsync/io.c b/usr.bin/rsync/io.c index 87019a9567a..6dac7228ec7 100644 --- a/usr.bin/rsync/io.c +++ b/usr.bin/rsync/io.c @@ -1,4 +1,4 @@ -/* $OpenBSD: io.c,v 1.21 2021/12/28 11:59:48 claudio Exp $ */ +/* $OpenBSD: io.c,v 1.22 2022/04/12 14:51:04 claudio Exp $ */ /* * Copyright (c) 2019 Kristaps Dzonsons * @@ -585,8 +585,9 @@ io_read_ulong(struct sess *sess, int fd, uint64_t *val) if (!io_read_int(sess, fd, &sval)) { ERRX1("io_read_int"); return 0; - } else if (sval != -1) { - *val = (uint64_t)le32toh(sval); + } + if (sval != -1) { + *val = sval; return 1; } -- cgit v1.2.3