Re: [PATCH] nfs: Keep index within mnt_errtbl[]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, 2009-07-13 at 01:25 +0200, Roel Kluin wrote:
> Ensure that index i remains within array mnt_errtbl[] and mnt3_errtbl[].
> 
> Signed-off-by: Roel Kluin <roel.kluin@xxxxxxxxx>
> ---
> diff --git a/fs/nfs/mount_clnt.c b/fs/nfs/mount_clnt.c
> index 38ef9ea..8b9affc 100644
> --- a/fs/nfs/mount_clnt.c
> +++ b/fs/nfs/mount_clnt.c
> @@ -258,7 +258,7 @@ static int decode_status(struct xdr_stream *xdr, struct mountres *res)
>  		return -EIO;
>  	status = ntohl(*p);
>  
> -	for (i = 0; i <= ARRAY_SIZE(mnt_errtbl); i++) {
> +	for (i = 0; i < ARRAY_SIZE(mnt_errtbl); i++) {
>  		if (mnt_errtbl[i].status == status) {
>  			res->errno = mnt_errtbl[i].errno;
>  			return 0;
> @@ -309,7 +309,7 @@ static int decode_fhs_status(struct xdr_stream *xdr, struct mountres *res)
>  		return -EIO;
>  	status = ntohl(*p);
>  
> -	for (i = 0; i <= ARRAY_SIZE(mnt3_errtbl); i++) {
> +	for (i = 0; i < ARRAY_SIZE(mnt3_errtbl); i++) {
>  		if (mnt3_errtbl[i].status == status) {
>  			res->errno = mnt3_errtbl[i].errno;
>  			return 0;

Yup. Good catch!

   Trond
-- 
Trond Myklebust
Linux NFS client maintainer

NetApp
Trond.Myklebust@xxxxxxxxxx
www.netapp.com
--
To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Filesystem Development]     [Linux USB Development]     [Linux Media Development]     [Video for Linux]     [Linux NILFS]     [Linux Audio Users]     [Yosemite Info]     [Linux SCSI]

  Powered by Linux