From 9d07494c06f3aaa797bc2b27e5fc8746b39c29ae Mon Sep 17 00:00:00 2001 From: delphij Date: Fri, 2 Oct 2015 16:37:06 +0000 Subject: [PATCH] Fix a regression with SA-15:24 patch that prevented NIS from working. Approved by: so git-svn-id: svn://svn.freebsd.org/base/releng/10.1@288512 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f --- UPDATING | 3 +++ sys/conf/newvers.sh | 2 +- usr.sbin/rpcbind/rpcb_svc_com.c | 11 +++++++---- 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/UPDATING b/UPDATING index 6e3dd4f9e..899867d52 100644 --- a/UPDATING +++ b/UPDATING @@ -16,6 +16,9 @@ from older versions of FreeBSD, try WITHOUT_CLANG to bootstrap to the tip of stable/10, and then rebuild without this option. The bootstrap process from older version of current is a bit fragile. +20151002: p22 FreeBSD-SA-15:24.rpcbind [revised] + Revised patch to address a regression that prevents NIS from working. + 20150929: p21 FreeBSD-SA-15:24.rpcbind Fix rpcbind(8) remote denial of service. [SA-15:24] diff --git a/sys/conf/newvers.sh b/sys/conf/newvers.sh index b12b344c7..f871db2a4 100644 --- a/sys/conf/newvers.sh +++ b/sys/conf/newvers.sh @@ -32,7 +32,7 @@ TYPE="FreeBSD" REVISION="10.1" -BRANCH="RELEASE-p21" +BRANCH="RELEASE-p22" if [ "X${BRANCH_OVERRIDE}" != "X" ]; then BRANCH=${BRANCH_OVERRIDE} fi diff --git a/usr.sbin/rpcbind/rpcb_svc_com.c b/usr.sbin/rpcbind/rpcb_svc_com.c index a72527343..72fea2841 100644 --- a/usr.sbin/rpcbind/rpcb_svc_com.c +++ b/usr.sbin/rpcbind/rpcb_svc_com.c @@ -1053,12 +1053,15 @@ static bool_t netbuf_copybuf(struct netbuf *dst, const struct netbuf *src) { - assert(dst->buf == NULL); + if (dst->len != src->len || dst->buf == NULL) { + if (dst->buf != NULL) + free(dst->buf); + if ((dst->buf = malloc(src->len)) == NULL) + return (FALSE); - if ((dst->buf = malloc(src->len)) == NULL) - return (FALSE); + dst->maxlen = dst->len = src->len; + } - dst->maxlen = dst->len = src->len; memcpy(dst->buf, src->buf, src->len); return (TRUE); } -- 2.42.0