Date: Wed, 24 Jan 1996 15:54:03 +1100 From: Bruce Evans <bde@zeta.org.au> To: m_tanaka@pa.yokogawa.co.jp, mpp@mpp.minn.net Cc: freebsd-hackers@freebsd.org Subject: Re: NFS trouble ? Message-ID: <199601240454.PAA31512@godzilla.zeta.org.au>
next in thread | raw e-mail | index | archive | help
>Index: nfs_bio.c >=================================================================== >RCS file: /usr/var/cvs/src/sys/nfs/nfs_bio.c,v >retrieving revision 1.21 >diff -u -r1.21 nfs_bio.c >--- nfs_bio.c 1995/12/17 21:12:13 1.21 >+++ nfs_bio.c 1996/01/23 20:03:38 >@@ -240,7 +240,8 @@ > */ > again: > bufsize = biosize; >- if ((lbn + 1) * biosize > np->n_size) { >+ if ((lbn + 1) * biosize > np->n_size && >+ (lbn + 1) * biosize - np->n_size < biosize) { > bufsize = np->n_size - lbn * biosize; > bufsize = (bufsize + DEV_BSIZE - 1) & ~(DEV_BSIZE - 1); > } >-- I think the changed should be >+ if ((off_t)(lbn + 1) * biosize > np->n_size) { There are several other similar potentially overflowing multiplications is nfs_bio.c. Bruce
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199601240454.PAA31512>