SSIDs are of length 32-bytes and not NUL terminated. Use the correct

length and bail immediatly if the returned length is wrong rather than
attempting to set an correct value.

This commit differs from the patch in the PR in the use of exit instead
of return and the use of a defined value for the array.

Submitted by:	Daan Vreeken [PA4DAN] <Danovitsch at Vitsch dot net>
PR:		bin/74509
This commit is contained in:
Brooks Davis 2005-10-30 16:31:05 +00:00
parent 94ac50dbcb
commit bed230409f

View File

@ -110,7 +110,7 @@ set80211ssid(const char *val, int d, int s, const struct afswtch *rafp)
{
int ssid;
int len;
u_int8_t data[33];
u_int8_t data[IEEE80211_NWID_LEN];
ssid = 0;
len = strlen(val);
@ -121,7 +121,8 @@ set80211ssid(const char *val, int d, int s, const struct afswtch *rafp)
bzero(data, sizeof(data));
len = sizeof(data);
get_string(val, NULL, data, &len);
if (get_string(val, NULL, data, &len) == NULL)
exit(1);
set80211(s, IEEE80211_IOC_SSID, ssid, len, data);
}