svn commit: r349376 - head/usr.sbin/mountd

Alexander Motin mav at FreeBSD.org
Tue Jun 25 17:00:54 UTC 2019


Author: mav
Date: Tue Jun 25 17:00:53 2019
New Revision: 349376
URL: https://svnweb.freebsd.org/changeset/base/349376

Log:
  Fix strsep_quote() on strings without quotes.
  
  For strings without quotes and escapes dstptr and srcptr are equal, so
  zeroing *dstptr before checking *srcptr is not a good idea.  In practice
  it means that in -maproot=65534:65533 everything after the colon is lost.
  
  The problem was there since r293305, but before r346976 it was covered by
  improper strsep_quote() usage.
  
  PR:		238725
  MFC after:	3 days
  Sponsored by:	iXsystems, Inc.

Modified:
  head/usr.sbin/mountd/mountd.c

Modified: head/usr.sbin/mountd/mountd.c
==============================================================================
--- head/usr.sbin/mountd/mountd.c	Tue Jun 25 16:49:20 2019	(r349375)
+++ head/usr.sbin/mountd/mountd.c	Tue Jun 25 17:00:53 2019	(r349376)
@@ -385,8 +385,8 @@ strsep_quote(char **stringp, const char *delim)
 		*dstptr++ = *srcptr++;
 	}
 
-	*dstptr = 0; /* Terminate the string */
 	*stringp = (*srcptr == '\0') ? NULL : srcptr + 1;
+	*dstptr = 0; /* Terminate the string */
 	return (retval);
 }
 


More information about the svn-src-head mailing list