- *hostname = hostdir;
- *dirname = s + 1;
- *s = '\0';
- /* Ignore all but first hostname in replicated mounts
- until they can be fully supported. (mack@sgi.com) */
- if ((s = strchr(hostdir, ','))) {
+ *pathname = '\0';
+ pathname++;
+
+ /*
+ * We don't need a copy of the pathname, but let's
+ * sanity check it anyway.
+ */
+ if (strlen(pathname) > NFS_MAXPATHNAME) {
+ nfs_error(_("%s: export pathname is too long"),
+ progname);
+ goto out;
+ }
+
+ /*
+ * Ignore all but first hostname in replicated mounts
+ * until they can be fully supported. (mack@sgi.com)
+ */
+ if ((s = strchr(dev, ','))) {