Index: citrus/citrus_csmapper.c =================================================================== RCS file: /cvsroot/src/lib/libc/citrus/citrus_csmapper.c,v retrieving revision 1.11 diff -u -u -r1.11 citrus_csmapper.c --- citrus/citrus_csmapper.c 20 Nov 2011 07:43:52 -0000 1.11 +++ citrus/citrus_csmapper.c 3 Oct 2019 15:35:25 -0000 @@ -305,7 +305,7 @@ struct _citrus_mapper * __restrict * __restrict rcm, const char *src, const char *pivot, const char *dst) { - char buf[PATH_MAX]; + char buf[4 * PATH_MAX]; snprintf(buf, sizeof(buf), "%s/%s,%s/%s", src, pivot, pivot, dst); Index: citrus/citrus_iconv.c =================================================================== RCS file: /cvsroot/src/lib/libc/citrus/citrus_iconv.c,v retrieving revision 1.10 diff -u -u -r1.10 citrus_iconv.c --- citrus/citrus_iconv.c 19 Nov 2011 18:34:21 -0000 1.10 +++ citrus/citrus_iconv.c 3 Oct 2019 15:35:25 -0000 @@ -262,7 +262,7 @@ int ret = 0; int hashval; struct _citrus_iconv_shared * ci; - char convname[PATH_MAX]; + char convname[2 * PATH_MAX]; snprintf(convname, sizeof(convname), "%s/%s", src, dst); Index: compat/sys/compat_statfs.c =================================================================== RCS file: /cvsroot/src/lib/libc/compat/sys/compat_statfs.c,v retrieving revision 1.8 diff -u -u -r1.8 compat_statfs.c --- compat/sys/compat_statfs.c 22 Sep 2019 22:59:38 -0000 1.8 +++ compat/sys/compat_statfs.c 3 Oct 2019 15:35:25 -0000 @@ -122,11 +122,9 @@ bfs->f_flags = (long)fs->f_flag; bfs->f_syncwrites = CLAMP(fs->f_syncwrites); bfs->f_asyncwrites = CLAMP(fs->f_asyncwrites); - (void)strncpy(bfs->f_fstypename, fs->f_fstypename, - sizeof(bfs->f_fstypename)); - (void)strncpy(bfs->f_mntonname, fs->f_mntonname, - sizeof(bfs->f_mntonname)); - (void)strncpy(bfs->f_mntfromname, fs->f_mntfromname, + memcpy(bfs->f_fstypename, fs->f_fstypename, sizeof(bfs->f_fstypename)); + memcpy(bfs->f_mntonname, fs->f_mntonname, sizeof(bfs->f_mntonname)); + memcpy(bfs->f_mntfromname, fs->f_mntfromname, sizeof(bfs->f_mntfromname)); } Index: db/db/db.c =================================================================== RCS file: /cvsroot/src/lib/libc/db/db/db.c,v retrieving revision 1.18 diff -u -u -r1.18 db.c --- db/db/db.c 19 May 2015 13:20:52 -0000 1.18 +++ db/db/db.c 3 Oct 2019 15:35:25 -0000 @@ -96,11 +96,12 @@ void __dbpanic(DB *dbp) { + void *dberr = __dberr; /* The only thing that can succeed is a close. */ - dbp->del = (int (*)(const struct __db *, const DBT*, u_int))__dberr; - dbp->fd = (int (*)(const struct __db *))__dberr; - dbp->get = (int (*)(const struct __db *, const DBT*, DBT *, u_int))__dberr; - dbp->put = (int (*)(const struct __db *, DBT *, const DBT *, u_int))__dberr; - dbp->seq = (int (*)(const struct __db *, DBT *, DBT *, u_int))__dberr; - dbp->sync = (int (*)(const struct __db *, u_int))__dberr; + dbp->del = (int (*)(const struct __db *, const DBT*, u_int))dberr; + dbp->fd = (int (*)(const struct __db *))dberr; + dbp->get = (int (*)(const struct __db *, const DBT*, DBT *, u_int))dberr; + dbp->put = (int (*)(const struct __db *, DBT *, const DBT *, u_int))dberr; + dbp->seq = (int (*)(const struct __db *, DBT *, DBT *, u_int))dberr; + dbp->sync = (int (*)(const struct __db *, u_int))dberr; } Index: gen/getlogin.c =================================================================== RCS file: /cvsroot/src/lib/libc/gen/getlogin.c,v retrieving revision 1.15 diff -u -u -r1.15 getlogin.c --- gen/getlogin.c 11 Jan 2009 02:46:27 -0000 1.15 +++ gen/getlogin.c 3 Oct 2019 15:35:25 -0000 @@ -126,7 +126,7 @@ if (len > namelen) { rv = ERANGE; } else { - strncpy(name, logname, len); + strlcpy(name, logname, len); rv = 0; } mutex_unlock(&logname_mutex); Index: net/getaddrinfo.c =================================================================== RCS file: /cvsroot/src/lib/libc/net/getaddrinfo.c,v retrieving revision 1.119 diff -u -u -r1.119 getaddrinfo.c --- net/getaddrinfo.c 13 Dec 2018 04:41:41 -0000 1.119 +++ net/getaddrinfo.c 3 Oct 2019 15:35:25 -0000 @@ -2842,8 +2842,7 @@ return -1; } if (n > 0 && name[--n] == '.') { - strncpy(nbuf, name, n); - nbuf[n] = '\0'; + strlcpy(nbuf, name, n); } else longname = name; } else { Index: resolv/res_query.c =================================================================== RCS file: /cvsroot/src/lib/libc/resolv/res_query.c,v retrieving revision 1.16 diff -u -u -r1.16 res_query.c --- resolv/res_query.c 24 Feb 2015 17:56:20 -0000 1.16 +++ resolv/res_query.c 3 Oct 2019 15:35:26 -0000 @@ -416,8 +416,7 @@ return (-1); } if (n && name[--n] == '.') { - strncpy(nbuf, name, n); - nbuf[n] = '\0'; + strlcpy(nbuf, name, n); } else longname = name; } else { Index: rpc/clnt_bcast.c =================================================================== RCS file: /cvsroot/src/lib/libc/rpc/clnt_bcast.c,v retrieving revision 1.26 diff -u -u -r1.26 clnt_bcast.c --- rpc/clnt_bcast.c 11 Mar 2013 20:19:28 -0000 1.26 +++ rpc/clnt_bcast.c 3 Oct 2019 15:35:26 -0000 @@ -634,7 +634,8 @@ /* else some kind of deserialization problem ... */ xdrs->x_op = XDR_FREE; - msg.acpted_rply.ar_results.proc = (xdrproc_t) xdr_void; + msg.acpted_rply.ar_results.proc = + (xdrproc_t)(void *)xdr_void; (void) xdr_replymsg(xdrs, &msg); (void) (*xresults)(xdrs, resultsp); XDR_DESTROY(xdrs); Index: rpc/clnt_generic.c =================================================================== RCS file: /cvsroot/src/lib/libc/rpc/clnt_generic.c,v retrieving revision 1.33 diff -u -u -r1.33 clnt_generic.c --- rpc/clnt_generic.c 28 May 2014 14:45:19 -0000 1.33 +++ rpc/clnt_generic.c 3 Oct 2019 15:35:26 -0000 @@ -99,8 +99,8 @@ } to.tv_sec = 10; to.tv_usec = 0; - rpc_stat = clnt_call(clnt, NULLPROC, (xdrproc_t) xdr_void, - NULL, (xdrproc_t) xdr_void, NULL, to); + rpc_stat = clnt_call(clnt, NULLPROC, (xdrproc_t)(void *)xdr_void, + NULL, (xdrproc_t)(void *)xdr_void, NULL, to); if (rpc_stat == RPC_SUCCESS) { *vers_out = vers_high; return (clnt); @@ -119,8 +119,9 @@ goto error; } CLNT_CONTROL(clnt, CLSET_VERS, (char *)(void *)&vers_high); - rpc_stat = clnt_call(clnt, NULLPROC, (xdrproc_t) xdr_void, - NULL, (xdrproc_t) xdr_void, NULL, to); + rpc_stat = clnt_call(clnt, NULLPROC, + (xdrproc_t)(void *)xdr_void, NULL, + (xdrproc_t)(void *)xdr_void, NULL, to); if (rpc_stat == RPC_SUCCESS) { *vers_out = vers_high; return (clnt); Index: rpc/clnt_vc.c =================================================================== RCS file: /cvsroot/src/lib/libc/rpc/clnt_vc.c,v retrieving revision 1.26 diff -u -u -r1.26 clnt_vc.c --- rpc/clnt_vc.c 20 Jan 2015 18:31:25 -0000 1.26 +++ rpc/clnt_vc.c 3 Oct 2019 15:35:26 -0000 @@ -425,7 +425,8 @@ for (;;) { reply_msg.acpted_rply.ar_verf = _null_auth; reply_msg.acpted_rply.ar_results.where = NULL; - reply_msg.acpted_rply.ar_results.proc = (xdrproc_t)xdr_void; + reply_msg.acpted_rply.ar_results.proc = + (xdrproc_t)(void *)xdr_void; if (! xdrrec_skiprecord(xdrs)) { release_fd_lock(ct->ct_fd, mask); return (ct->ct_error.re_status); Index: rpc/getrpcent.c =================================================================== RCS file: /cvsroot/src/lib/libc/rpc/getrpcent.c,v retrieving revision 1.23 diff -u -u -r1.23 getrpcent.c --- rpc/getrpcent.c 11 Mar 2013 20:19:29 -0000 1.23 +++ rpc/getrpcent.c 3 Oct 2019 15:35:26 -0000 @@ -185,7 +185,7 @@ if (d == 0) return (0); - (void) strncpy(d->line, val, len); + strlcpy(d->line, val, len); p = d->line; d->line[len] = '\n'; if (*p == '#') Index: rpc/pmap_getmaps.c =================================================================== RCS file: /cvsroot/src/lib/libc/rpc/pmap_getmaps.c,v retrieving revision 1.18 diff -u -u -r1.18 pmap_getmaps.c --- rpc/pmap_getmaps.c 11 Mar 2013 20:19:29 -0000 1.18 +++ rpc/pmap_getmaps.c 3 Oct 2019 15:35:26 -0000 @@ -95,7 +95,7 @@ PMAPVERS, &sock, 50, 500); if (client != NULL) { if (CLNT_CALL(client, (rpcproc_t)PMAPPROC_DUMP, - (xdrproc_t)xdr_void, NULL, + (xdrproc_t)(void *)xdr_void, NULL, (xdrproc_t)xdr_pmaplist, &head, minutetimeout) != RPC_SUCCESS) { clnt_perror(client, "pmap_getmaps rpc problem"); Index: rpc/rpc_generic.c =================================================================== RCS file: /cvsroot/src/lib/libc/rpc/rpc_generic.c,v retrieving revision 1.30 diff -u -u -r1.30 rpc_generic.c --- rpc/rpc_generic.c 3 May 2017 21:39:27 -0000 1.30 +++ rpc/rpc_generic.c 3 Oct 2019 15:35:26 -0000 @@ -481,8 +481,8 @@ { struct timeval TIMEOUT = {25, 0}; - if (clnt_call(clnt, NULLPROC, (xdrproc_t) xdr_void, NULL, - (xdrproc_t) xdr_void, NULL, TIMEOUT) != RPC_SUCCESS) { + if (clnt_call(clnt, NULLPROC, (xdrproc_t)(void *)xdr_void, NULL, + (xdrproc_t)(void *)xdr_void, NULL, TIMEOUT) != RPC_SUCCESS) { return (NULL); } return ((void *) clnt); Index: rpc/rpcb_clnt.c =================================================================== RCS file: /cvsroot/src/lib/libc/rpc/rpcb_clnt.c,v retrieving revision 1.31 diff -u -u -r1.31 rpcb_clnt.c --- rpc/rpcb_clnt.c 26 Mar 2015 11:31:57 -0000 1.31 +++ rpc/rpcb_clnt.c 3 Oct 2019 15:35:26 -0000 @@ -1030,7 +1030,7 @@ return (head); } clnt_st = CLNT_CALL(client, (rpcproc_t)RPCBPROC_DUMP, - (xdrproc_t) xdr_void, NULL, (xdrproc_t) xdr_rpcblist_ptr, + (xdrproc_t)(void *)xdr_void, NULL, (xdrproc_t) xdr_rpcblist_ptr, (char *)(void *)&head, tottimeout); if (clnt_st == RPC_SUCCESS) goto done; @@ -1048,7 +1048,8 @@ vers = RPCBVERS; CLNT_CONTROL(client, CLSET_VERS, (char *)(void *)&vers); if (CLNT_CALL(client, (rpcproc_t)RPCBPROC_DUMP, - (xdrproc_t) xdr_void, NULL, (xdrproc_t) xdr_rpcblist_ptr, + (xdrproc_t)(void *)xdr_void, NULL, + (xdrproc_t) xdr_rpcblist_ptr, (char *)(void *)&head, tottimeout) == RPC_SUCCESS) goto done; } @@ -1181,7 +1182,7 @@ } st = CLNT_CALL(client, (rpcproc_t)RPCBPROC_GETTIME, - (xdrproc_t) xdr_void, NULL, + (xdrproc_t)(void *)xdr_void, NULL, (xdrproc_t) xdr_int, (char *)(void *)timep, tottimeout); if ((st == RPC_PROGVERSMISMATCH) || (st == RPC_PROGUNAVAIL)) { @@ -1191,7 +1192,7 @@ vers = RPCBVERS; CLNT_CONTROL(client, CLSET_VERS, (char *)(void *)&vers); st = CLNT_CALL(client, (rpcproc_t)RPCBPROC_GETTIME, - (xdrproc_t) xdr_void, NULL, + (xdrproc_t)(void *)xdr_void, NULL, (xdrproc_t) xdr_int, (char *)(void *)timep, tottimeout); } Index: rpc/svc_simple.c =================================================================== RCS file: /cvsroot/src/lib/libc/rpc/svc_simple.c,v retrieving revision 1.33 diff -u -u -r1.33 svc_simple.c --- rpc/svc_simple.c 11 Mar 2013 20:19:29 -0000 1.33 +++ rpc/svc_simple.c 3 Oct 2019 15:35:26 -0000 @@ -271,7 +271,7 @@ * enforce "procnum 0 is echo" convention */ if (rqstp->rq_proc == NULLPROC) { - if (svc_sendreply(transp, (xdrproc_t) xdr_void, NULL) == + if (svc_sendreply(transp, (xdrproc_t)(void *)xdr_void, NULL) == FALSE) { warnx("%s: svc_sendreply failed", __func__); } @@ -301,7 +301,7 @@ } outdata = (*(pl->p_progname))(xdrbuf); if (outdata == NULL && - pl->p_outproc != (xdrproc_t) xdr_void){ + pl->p_outproc != (xdrproc_t)(void *)xdr_void) { /* there was an error */ mutex_unlock(&proglst_lock); return; Index: rpc/xdr_sizeof.c =================================================================== RCS file: /cvsroot/src/lib/libc/rpc/xdr_sizeof.c,v retrieving revision 1.5 diff -u -u -r1.5 xdr_sizeof.c --- rpc/xdr_sizeof.c 11 Mar 2013 20:19:30 -0000 1.5 +++ rpc/xdr_sizeof.c 3 Oct 2019 15:35:26 -0000 @@ -156,8 +156,8 @@ ops.x_destroy = x_destroy; /* the other harmless ones */ - ops.x_getlong = (dummyfunc1) harmless; - ops.x_getbytes = (dummyfunc2) harmless; + ops.x_getlong = (dummyfunc1)(void *)harmless; + ops.x_getbytes = (dummyfunc2)(void *)harmless; x.x_op = XDR_ENCODE; x.x_ops = &ops;