From: Steve Dickson <steved@redhat.com>
To: Linux NFS Mailing list <linux-nfs@vger.kernel.org>
Subject: [PATCH] exportfs: Don't buffer overflow on exports that are too big.
Date: Wed, 8 Jan 2014 13:47:10 -0500 [thread overview]
Message-ID: <1389206830-5368-1-git-send-email-steved@redhat.com> (raw)
Signe-doff-by: Steve Dickson <steved@redhat.com>
---
utils/exportfs/exportfs.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/utils/exportfs/exportfs.c b/utils/exportfs/exportfs.c
index 9ea86cb..8c86790 100644
--- a/utils/exportfs/exportfs.c
+++ b/utils/exportfs/exportfs.c
@@ -452,6 +452,8 @@ static int test_export(char *path, int with_fsid)
bp += n;
len -= n;
qword_add(&bp, &len, path);
+ if (len < 1)
+ return 0;
snprintf(bp, len, " 3 %d 65534 65534 0\n", with_fsid ? NFSEXP_FSID : 0);
fd = open("/proc/net/rpc/nfsd.export/channel", O_WRONLY);
if (fd < 0)
--
1.8.3.1
next reply other threads:[~2014-01-08 18:45 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-01-08 18:47 Steve Dickson [this message]
2014-01-20 22:02 ` [PATCH] exportfs: Don't buffer overflow on exports that are too big Steve Dickson
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1389206830-5368-1-git-send-email-steved@redhat.com \
--to=steved@redhat.com \
--cc=linux-nfs@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox