From owner-p4-projects@FreeBSD.ORG Wed Mar 30 05:24:15 2005 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id F2EC116A4D0; Wed, 30 Mar 2005 05:24:14 +0000 (GMT) Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id CEB2E16A4CE for ; Wed, 30 Mar 2005 05:24:14 +0000 (GMT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 8EEC843D58 for ; Wed, 30 Mar 2005 05:24:14 +0000 (GMT) (envelope-from sam@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.1/8.13.1) with ESMTP id j2U5OE1i005081 for ; Wed, 30 Mar 2005 05:24:14 GMT (envelope-from sam@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id j2U5OEQE005078 for perforce@freebsd.org; Wed, 30 Mar 2005 05:24:14 GMT (envelope-from sam@freebsd.org) Date: Wed, 30 Mar 2005 05:24:14 GMT Message-Id: <200503300524.j2U5OEQE005078@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to sam@freebsd.org using -f From: Sam Leffler To: Perforce Change Reviews Subject: PERFORCE change 74084 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Mar 2005 05:24:15 -0000 http://perforce.freebsd.org/chv.cgi?CH=74084 Change 74084 by sam@sam_ebb on 2005/03/30 05:23:39 misc coverity fixes kame awaiting kame review Affected files ... .. //depot/projects/wifi/sys/netinet6/ah_core.c#4 edit .. //depot/projects/wifi/sys/netinet6/esp_core.c#3 edit Differences ... ==== //depot/projects/wifi/sys/netinet6/ah_core.c#4 (text+ko) ==== @@ -1400,8 +1400,6 @@ (algo->result)(&algos, sumbuf, sizeof(sumbuf)); bcopy(&sumbuf[0], ahdat, (*algo->sumsiz)(sav)); - if (n) - m_free(n); return error; fail: @@ -1632,9 +1630,6 @@ (algo->result)(&algos, sumbuf, sizeof(sumbuf)); bcopy(&sumbuf[0], ahdat, (*algo->sumsiz)(sav)); - /* just in case */ - if (n) - m_free(n); return 0; fail: /* just in case */ ==== //depot/projects/wifi/sys/netinet6/esp_core.c#3 (text+ko) ==== @@ -1,4 +1,4 @@ -/* $FreeBSD: src/sys/netinet6/esp_core.c,v 1.22 2005/01/07 02:30:34 imp Exp $ */ +/* $FreeBSD: src/sys/netinet6/esp_core.c,v 1.23 2005/03/11 12:37:06 ume Exp $ */ /* $KAME: esp_core.c,v 1.50 2000/11/02 12:27:38 itojun Exp $ */ /*- @@ -75,7 +75,15 @@ #include #include -#include + +#include +#define cast128_key cast_key +#define cast128_setkey(key, rawkey, keybytes) \ + cast_setkey((key), (rawkey), (keybytes)) +#define cast128_encrypt(key, inblock, outblock) \ + cast_encrypt((key), (inblock), (outblock)) +#define cast128_decrypt(key, inblock, outblock) \ + cast_decrypt((key), (inblock), (outblock)) #include @@ -409,7 +417,7 @@ algo = esp_algorithm_lookup(sav->alg_enc); if (!algo) { ipseclog((LOG_ERR, - "esp_cbc_mature %s: unsupported algorithm.\n", algo->name)); + "esp_cbc_mature %d: unsupported algorithm.\n", sav->alg_enc)); return 1; } @@ -713,6 +721,7 @@ /* skip bodyoff */ while (soff < bodyoff) { + KASSERT(s != NULL, ("malformed mbuf chain")); if (soff + s->m_len >= bodyoff) { sn = bodyoff - soff; break; @@ -730,6 +739,7 @@ while (soff < m->m_pkthdr.len) { /* source */ + KASSERT(s != NULL, ("malformed mbuf chain")); if (sn + blocklen <= s->m_len) { /* body is continuous */ sp = mtod(s, u_int8_t *) + sn; @@ -923,6 +933,7 @@ /* skip bodyoff */ while (soff < bodyoff) { + KASSERT(s != NULL, ("malformed mbuf chain")); if (soff + s->m_len >= bodyoff) { sn = bodyoff - soff; break; @@ -940,6 +951,7 @@ while (soff < m->m_pkthdr.len) { /* source */ + KASSERT(s != NULL, ("malformed mbuf chain")); if (sn + blocklen <= s->m_len) { /* body is continuous */ sp = mtod(s, u_int8_t *) + sn;