From owner-svn-src-head@freebsd.org Mon Oct 16 07:15:52 2017 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 5FA95E3196D; Mon, 16 Oct 2017 07:15:52 +0000 (UTC) (envelope-from avos@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 CF74E70428; Mon, 16 Oct 2017 07:15:51 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v9G7Fojl070359; Mon, 16 Oct 2017 07:15:50 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9G7Fo14070358; Mon, 16 Oct 2017 07:15:50 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201710160715.v9G7Fo14070358@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Mon, 16 Oct 2017 07:15:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324658 - head/usr.sbin/wlandebug X-SVN-Group: head X-SVN-Commit-Author: avos X-SVN-Commit-Paths: head/usr.sbin/wlandebug X-SVN-Commit-Revision: 324658 X-SVN-Commit-Repository: base 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: Mon, 16 Oct 2017 07:15:52 -0000 Author: avos Date: Mon Oct 16 07:15:50 2017 New Revision: 324658 URL: https://svnweb.freebsd.org/changeset/base/324658 Log: wlandebug(8): add a sanity check. Modified: head/usr.sbin/wlandebug/wlandebug.c Modified: head/usr.sbin/wlandebug/wlandebug.c ============================================================================== --- head/usr.sbin/wlandebug/wlandebug.c Mon Oct 16 07:01:27 2017 (r324657) +++ head/usr.sbin/wlandebug/wlandebug.c Mon Oct 16 07:15:50 2017 (r324658) @@ -172,6 +172,9 @@ get_orig_iface_name(char *oid, size_t oid_size, char * if (ifconfig_get_orig_name(h, name, &orig_name) < 0) errc(1, ifconfig_err_errno(h), "cannot get interface name"); + if (strlen(orig_name) < strlen("wlan") + 1) + errx(1, "expecting a wlan interface name"); + ifconfig_close(h); setoid(oid, oid_size, orig_name); free(orig_name);