Date: Thu, 27 Jun 2019 14:10:59 +0000 (UTC) From: Alexander Motin <mav@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r349456 - stable/12/usr.sbin/mountd Message-ID: <201906271410.x5REAxrw041617@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: mav Date: Thu Jun 27 14:10:58 2019 New Revision: 349456 URL: https://svnweb.freebsd.org/changeset/base/349456 Log: MFC r349376: 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 Modified: stable/12/usr.sbin/mountd/mountd.c Directory Properties: stable/12/ (props changed) Modified: stable/12/usr.sbin/mountd/mountd.c ============================================================================== --- stable/12/usr.sbin/mountd/mountd.c Thu Jun 27 14:03:32 2019 (r349455) +++ stable/12/usr.sbin/mountd/mountd.c Thu Jun 27 14:10:58 2019 (r349456) @@ -351,8 +351,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); }
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201906271410.x5REAxrw041617>