From f5b7359a005e6f85cdc57e8a20d3b16e6d355777 Mon Sep 17 00:00:00 2001 From: Conrad Meyer Date: Tue, 27 Jun 2017 17:23:20 +0000 Subject: [PATCH] Fix one more place uio_resid is truncated to int A follow-up to r231949 and r194990. Reported by: pho@ Reviewed by: kib@, markj@ Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D11373 --- sys/kern/uipc_mbuf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/kern/uipc_mbuf.c b/sys/kern/uipc_mbuf.c index 7cff0a7d9251..4d4cb3888ee1 100644 --- a/sys/kern/uipc_mbuf.c +++ b/sys/kern/uipc_mbuf.c @@ -1517,7 +1517,7 @@ m_uiotombuf(struct uio *uio, int how, int len, int align, int flags) * the total data supplied by the uio. */ if (len > 0) - total = min(uio->uio_resid, len); + total = (uio->uio_resid < len) ? uio->uio_resid : len; else total = uio->uio_resid;