public inbox for linux-nfs@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] exportfs: Don't buffer overflow on exports that are too big.
@ 2014-01-08 18:47 Steve Dickson
  2014-01-20 22:02 ` Steve Dickson
  0 siblings, 1 reply; 2+ messages in thread
From: Steve Dickson @ 2014-01-08 18:47 UTC (permalink / raw)
  To: Linux NFS Mailing list

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


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2014-01-20 22:00 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-01-08 18:47 [PATCH] exportfs: Don't buffer overflow on exports that are too big Steve Dickson
2014-01-20 22:02 ` Steve Dickson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox