From owner-svn-src-head@freebsd.org Tue Nov 22 17:36:17 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F1A7BC50FF4; Tue, 22 Nov 2016 17:36:17 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A7C1B1F33; Tue, 22 Nov 2016 17:36:17 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uAMHaGCM055000; Tue, 22 Nov 2016 17:36:16 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uAMHaGZw054999; Tue, 22 Nov 2016 17:36:16 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201611221736.uAMHaGZw054999@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Tue, 22 Nov 2016 17:36:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309014 - head/sys/net80211 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Nov 2016 17:36:18 -0000 Author: adrian Date: Tue Nov 22 17:36:16 2016 New Revision: 309014 URL: https://svnweb.freebsd.org/changeset/base/309014 Log: [net80211] high oops on the high seas, or "god damnit compilers, it's 2016 and you're supposed to save me from this." TODO: * drink real coffee before committing in the morning, or there's a high risk of more obviously self-evident commits being turned into attempts at humour. Reported by: cem, Coverity CID 1366219 Modified: head/sys/net80211/ieee80211_crypto_ccmp.c Modified: head/sys/net80211/ieee80211_crypto_ccmp.c ============================================================================== --- head/sys/net80211/ieee80211_crypto_ccmp.c Tue Nov 22 17:14:09 2016 (r309013) +++ head/sys/net80211/ieee80211_crypto_ccmp.c Tue Nov 22 17:36:16 2016 (r309014) @@ -241,7 +241,7 @@ ccmp_decap(struct ieee80211_key *k, stru rxs = ieee80211_get_rx_params_ptr(m); - if ((rxs != NULL) & (rxs->c_pktflags & IEEE80211_RX_F_IV_STRIP)) + if ((rxs != NULL) && (rxs->c_pktflags & IEEE80211_RX_F_IV_STRIP)) goto finish; /* @@ -286,7 +286,7 @@ finish: /* * Copy up 802.11 header and strip crypto bits. */ - if (! ((rxs != NULL) & (rxs->c_pktflags & IEEE80211_RX_F_IV_STRIP))) { + if (! ((rxs != NULL) && (rxs->c_pktflags & IEEE80211_RX_F_IV_STRIP))) { ovbcopy(mtod(m, void *), mtod(m, uint8_t *) + ccmp.ic_header, hdrlen); m_adj(m, ccmp.ic_header); @@ -295,13 +295,13 @@ finish: /* * XXX TODO: see if MMIC_STRIP also covers CCMP MIC trailer. */ - if (! ((rxs != NULL) & (rxs->c_pktflags & IEEE80211_RX_F_MMIC_STRIP))) + if (! ((rxs != NULL) && (rxs->c_pktflags & IEEE80211_RX_F_MMIC_STRIP))) m_adj(m, -ccmp.ic_trailer); /* * Ok to update rsc now. */ - if (! ((rxs != NULL) & (rxs->c_pktflags & IEEE80211_RX_F_IV_STRIP))) { + if (! ((rxs != NULL) && (rxs->c_pktflags & IEEE80211_RX_F_IV_STRIP))) { k->wk_keyrsc[tid] = pn; }