From b70c7b1abca63cbb87b18d79b8d86a0e65371643 Mon Sep 17 00:00:00 2001 From: "J. Bruce Fields" Date: Tue, 22 Jan 2008 17:40:42 -0500 Subject: [PATCH] --- yaml --- r: 82497 b: refs/heads/master c: 87d26ea7771ad637035e6bd5a2700d81ee9162da h: refs/heads/master i: 82495: 33e76dea44a232303e7a9165038e324664ff62d4 v: v3 --- [refs] | 2 +- trunk/fs/nfsd/nfsctl.c | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/[refs] b/[refs] index d779e3d5f7aa..f201158c83db 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 50431d94e732ba71b66a83c5435890728e313095 +refs/heads/master: 87d26ea7771ad637035e6bd5a2700d81ee9162da diff --git a/trunk/fs/nfsd/nfsctl.c b/trunk/fs/nfsd/nfsctl.c index bc22e0b0343a..8516137cdbb0 100644 --- a/trunk/fs/nfsd/nfsctl.c +++ b/trunk/fs/nfsd/nfsctl.c @@ -304,6 +304,9 @@ static ssize_t write_filehandle(struct file *file, char *buf, size_t size) struct auth_domain *dom; struct knfsd_fh fh; + if (size == 0) + return -EINVAL; + if (buf[size-1] != '\n') return -EINVAL; buf[size-1] = 0; @@ -663,7 +666,7 @@ static ssize_t write_recoverydir(struct file *file, char *buf, size_t size) char *recdir; int len, status; - if (size > PATH_MAX || buf[size-1] != '\n') + if (size == 0 || size > PATH_MAX || buf[size-1] != '\n') return -EINVAL; buf[size-1] = 0;