diff options
author | David Hill <dhill@cvs.openbsd.org> | 2018-04-02 14:19:18 +0000 |
---|---|---|
committer | David Hill <dhill@cvs.openbsd.org> | 2018-04-02 14:19:18 +0000 |
commit | bae2115e6199e500bb390ab34b1bfde4729c4b9a (patch) | |
tree | ea35b5379b4604cac0f508c0d3f4f87cfba64846 /sys/netinet/tcp_subr.c | |
parent | 264ab773e4c22f84343bfe7dd91127663fa02643 (diff) |
Use memcpy on freshly allocated memory and add the free size.
OK millert@
Diffstat (limited to 'sys/netinet/tcp_subr.c')
-rw-r--r-- | sys/netinet/tcp_subr.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/sys/netinet/tcp_subr.c b/sys/netinet/tcp_subr.c index 4562f8f4630..e5cbd4bc9d1 100644 --- a/sys/netinet/tcp_subr.c +++ b/sys/netinet/tcp_subr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: tcp_subr.c,v 1.169 2018/03/18 21:05:21 bluhm Exp $ */ +/* $OpenBSD: tcp_subr.c,v 1.170 2018/04/02 14:19:17 dhill Exp $ */ /* $NetBSD: tcp_subr.c,v 1.22 1996/02/13 23:44:00 christos Exp $ */ /* @@ -952,7 +952,7 @@ tcp_signature_tdb_init(struct tdb *tdbp, struct xformsw *xsp, tdbp->tdb_amxkey = malloc(ii->ii_authkeylen, M_XDATA, M_NOWAIT); if (tdbp->tdb_amxkey == NULL) return (ENOMEM); - bcopy(ii->ii_authkey, tdbp->tdb_amxkey, ii->ii_authkeylen); + memcpy(tdbp->tdb_amxkey, ii->ii_authkey, ii->ii_authkeylen); tdbp->tdb_amxkeylen = ii->ii_authkeylen; return (0); @@ -963,7 +963,7 @@ tcp_signature_tdb_zeroize(struct tdb *tdbp) { if (tdbp->tdb_amxkey) { explicit_bzero(tdbp->tdb_amxkey, tdbp->tdb_amxkeylen); - free(tdbp->tdb_amxkey, M_XDATA, 0); + free(tdbp->tdb_amxkey, M_XDATA, tdbp->tdb_amxkeylen); tdbp->tdb_amxkey = NULL; } |