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);
_______________________________________________
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to