diff --git a/fs/nfsd/export.c b/fs/nfsd/export.c index 62f3b9074e8490897af08811ec184cacc9ad554b..5f312abf124786c44ab60b96556e12a552c2460e 100644 --- a/fs/nfsd/export.c +++ b/fs/nfsd/export.c @@ -87,7 +87,7 @@ static int expkey_parse(struct cache_detail *cd, char *mesg, int mlen) struct svc_expkey key; struct svc_expkey *ek = NULL; - if (mesg[mlen-1] != '\n') + if (mlen < 1 || mesg[mlen-1] != '\n') return -EINVAL; mesg[mlen-1] = 0;