diff options
author | Angelos D. Keromytis <angelos@cvs.openbsd.org> | 2001-05-12 18:09:03 +0000 |
---|---|---|
committer | Angelos D. Keromytis <angelos@cvs.openbsd.org> | 2001-05-12 18:09:03 +0000 |
commit | b144bf6e8365a2df344f9e99f0b7f2a6f9318513 (patch) | |
tree | 9fa7f02823b441538ed8b974738cef418dfa75a1 /sys/netinet/ip_ah.c | |
parent | cc5e29e35735db9dbef34fd248a0e8120c0a040f (diff) |
Move bzero() after test for correct allocation (jj@wabbitt.org)
Diffstat (limited to 'sys/netinet/ip_ah.c')
-rw-r--r-- | sys/netinet/ip_ah.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/sys/netinet/ip_ah.c b/sys/netinet/ip_ah.c index 3e3f6533e08..505f4051278 100644 --- a/sys/netinet/ip_ah.c +++ b/sys/netinet/ip_ah.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ip_ah.c,v 1.50 2001/04/14 00:30:58 angelos Exp $ */ +/* $OpenBSD: ip_ah.c,v 1.51 2001/05/12 18:09:02 angelos Exp $ */ /* * The authors of this code are John Ioannidis (ji@tla.org), @@ -607,7 +607,6 @@ ah_input(struct mbuf *m, struct tdb *tdb, int skip, int protoff) /* Allocate IPsec-specific opaque crypto info */ MALLOC(tc, struct tdb_crypto *, sizeof(struct tdb_crypto), M_XDATA, M_NOWAIT); - bzero(tc, sizeof(struct tdb_crypto)); if (tc == NULL) { m_freem(m); @@ -616,6 +615,7 @@ ah_input(struct mbuf *m, struct tdb *tdb, int skip, int protoff) ahstat.ahs_crypto++; return ENOBUFS; } + bzero(tc, sizeof(struct tdb_crypto)); /* * Save the authenticator, the skipped portion of the packet, and the @@ -1048,7 +1048,6 @@ ah_output(struct mbuf *m, struct tdb *tdb, struct mbuf **mp, int skip, /* Allocate IPsec-specific opaque crypto info */ MALLOC(tc, struct tdb_crypto *, sizeof(struct tdb_crypto), M_XDATA, M_NOWAIT); - bzero(tc, sizeof(struct tdb_crypto)); if (tc == NULL) { m_freem(m); @@ -1057,6 +1056,7 @@ ah_output(struct mbuf *m, struct tdb *tdb, struct mbuf **mp, int skip, ahstat.ahs_crypto++; return ENOBUFS; } + bzero(tc, sizeof(struct tdb_crypto)); /* Save the skipped portion of the packet */ MALLOC(tc->tc_ptr, caddr_t, skip, M_XDATA, M_NOWAIT); |