aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorXin LI <delphij@FreeBSD.org>2015-10-02 16:35:41 +0000
committerXin LI <delphij@FreeBSD.org>2015-10-02 16:35:41 +0000
commit0ed633d0f83d928a909b86f5c0c6e7d495e0900c (patch)
tree44a013a058985674f221c00e7d11d652cc8933a3
parentd847071cf656294feae5d7ddc0333d5415a014b9 (diff)
downloadsrc-0ed633d0f83d928a909b86f5c0c6e7d495e0900c.tar.gz
src-0ed633d0f83d928a909b86f5c0c6e7d495e0900c.zip
Fix a regression with SA-15:24 patch that prevented NIS from
working.
Notes
Notes: svn path=/head/; revision=288510
-rw-r--r--usr.sbin/rpcbind/rpcb_svc_com.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/usr.sbin/rpcbind/rpcb_svc_com.c b/usr.sbin/rpcbind/rpcb_svc_com.c
index a88f61947f96..326224a6062e 100644
--- a/usr.sbin/rpcbind/rpcb_svc_com.c
+++ b/usr.sbin/rpcbind/rpcb_svc_com.c
@@ -1052,12 +1052,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);
}