Skip to content

Commit

Permalink
don't SEGV on "wiconfig -p 1" (no interface specified).
Browse files Browse the repository at this point in the history
  • Loading branch information
itojun committed Mar 26, 2000
1 parent 61106a4 commit 7ef1c9d
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions netbsd/usr.sbin/wiconfig/wiconfig.c
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,9 @@ void wi_setword(iface, code, word)
{
struct wi_req wreq;

if (iface == NULL)
errx(1, "must specify interface name");

bzero((char *)&wreq, sizeof(wreq));

wreq.wi_type = code;
Expand Down Expand Up @@ -472,6 +475,9 @@ static void wi_dumpinfo(iface)
int i, has_wep;
struct wi_table *w;

if (iface == NULL)
errx(1, "must specify interface name");

bzero((char *)&wreq, sizeof(wreq));

wreq.wi_len = WI_MAX_DATALEN;
Expand Down

0 comments on commit 7ef1c9d

Please sign in to comment.