From owner-svn-src-stable-11@freebsd.org Fri Sep 2 17:24:18 2016 Return-Path: Delivered-To: svn-src-stable-11@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 029B0BCCE32; Fri, 2 Sep 2016 17:24:18 +0000 (UTC) (envelope-from dim@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 A2E436B4; Fri, 2 Sep 2016 17:24:17 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u82HOGgW020756; Fri, 2 Sep 2016 17:24:16 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u82HOG3M020754; Fri, 2 Sep 2016 17:24:16 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201609021724.u82HOG3M020754@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Fri, 2 Sep 2016 17:24:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r305287 - in stable: 10/usr.sbin/bluetooth/btpand 11/usr.sbin/bluetooth/btpand X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Sep 2016 17:24:18 -0000 Author: dim Date: Fri Sep 2 17:24:16 2016 New Revision: 305287 URL: https://svnweb.freebsd.org/changeset/base/305287 Log: MFC r305023: Avoid undefined behavior when calling va_start() in bnep_send_control(), by making the 'type' parameter a plain unsigned. Modified: stable/11/usr.sbin/bluetooth/btpand/bnep.c stable/11/usr.sbin/bluetooth/btpand/btpand.h Directory Properties: stable/11/ (props changed) Changes in other areas also in this revision: Modified: stable/10/usr.sbin/bluetooth/btpand/bnep.c stable/10/usr.sbin/bluetooth/btpand/btpand.h Directory Properties: stable/10/ (props changed) Modified: stable/11/usr.sbin/bluetooth/btpand/bnep.c ============================================================================== --- stable/11/usr.sbin/bluetooth/btpand/bnep.c Fri Sep 2 17:07:52 2016 (r305286) +++ stable/11/usr.sbin/bluetooth/btpand/bnep.c Fri Sep 2 17:24:16 2016 (r305287) @@ -574,7 +574,7 @@ bnep_recv_filter_multi_addr_rsp(channel_ } void -bnep_send_control(channel_t *chan, uint8_t type, ...) +bnep_send_control(channel_t *chan, unsigned type, ...) { packet_t *pkt; uint8_t *p; @@ -590,7 +590,7 @@ bnep_send_control(channel_t *chan, uint8 va_start(ap, type); *p++ = BNEP_CONTROL; - *p++ = type; + *p++ = (uint8_t)type; switch(type) { case BNEP_CONTROL_COMMAND_NOT_UNDERSTOOD: Modified: stable/11/usr.sbin/bluetooth/btpand/btpand.h ============================================================================== --- stable/11/usr.sbin/bluetooth/btpand/btpand.h Fri Sep 2 17:07:52 2016 (r305286) +++ stable/11/usr.sbin/bluetooth/btpand/btpand.h Fri Sep 2 17:24:16 2016 (r305287) @@ -183,7 +183,7 @@ b2eaddr(void *dst, bdaddr_t *src) /* bnep.c */ bool bnep_send(channel_t *, packet_t *); bool bnep_recv(packet_t *); -void bnep_send_control(channel_t *, uint8_t, ...); +void bnep_send_control(channel_t *, unsigned, ...); /* channel.c */ void channel_init(void);