diff options
author | delphij <delphij@FreeBSD.org> | 2015-10-02 16:35:41 +0000 |
---|---|---|
committer | delphij <delphij@FreeBSD.org> | 2015-10-02 16:35:41 +0000 |
commit | 5f0779b2e82cd4e5d99c4ad8190663a018af2bbf (patch) | |
tree | 44a013a058985674f221c00e7d11d652cc8933a3 | |
parent | 5078e3ded98e588f96aad37c099a3301c17e2534 (diff) | |
download | FreeBSD-src-5f0779b2e82cd4e5d99c4ad8190663a018af2bbf.zip FreeBSD-src-5f0779b2e82cd4e5d99c4ad8190663a018af2bbf.tar.gz |
Fix a regression with SA-15:24 patch that prevented NIS from
working.
-rw-r--r-- | usr.sbin/rpcbind/rpcb_svc_com.c | 11 |
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 a88f619..326224a 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); } |