mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-08-29 00:11:14 +02:00
libiw/iwscan.cpp: fix crash in case of different cmd order
This commit is contained in:
@@ -219,6 +219,11 @@ realloc:
|
||||
if (ret <= 0)
|
||||
break;
|
||||
switch(event->cmd) {
|
||||
case SIOCGIWAP:
|
||||
count++;
|
||||
networks.push_back(network);
|
||||
printf(" Network %d:\n", count+1);
|
||||
break;
|
||||
case SIOCGIWESSID:
|
||||
{
|
||||
char essid[IW_ESSID_MAX_SIZE+1];
|
||||
@@ -228,14 +233,12 @@ realloc:
|
||||
if(event->u.essid.flags)
|
||||
{
|
||||
printf(" ESSID:\"%s\"\n", essid);
|
||||
network.ssid = essid;
|
||||
networks[count].ssid = essid;
|
||||
}
|
||||
else {
|
||||
printf(" ESSID:off/any/hidden\n");
|
||||
network.ssid = "(hidden)";
|
||||
networks[count].ssid = "(hidden)";
|
||||
}
|
||||
count++;
|
||||
networks.push_back(network);
|
||||
}
|
||||
|
||||
break;
|
||||
|
Reference in New Issue
Block a user