Fixed crash when no SSID found

pull/169/head
Hieromon Ikasamo 5 years ago
parent 56ba89649f
commit 246d600f62
  1. 2
      src/AutoConnectPage.cpp

@ -1157,7 +1157,7 @@ String AutoConnect::_token_LIST_SSID(PageArgument& args) {
AC_DBG("%d network(s) found\n", (int)_scanCount); AC_DBG("%d network(s) found\n", (int)_scanCount);
} }
// Preapre SSID list content building buffer // Preapre SSID list content building buffer
size_t bufSize = 192 * (_scanCount > AUTOCONNECT_SSIDPAGEUNIT_LINES ? AUTOCONNECT_SSIDPAGEUNIT_LINES : _scanCount); size_t bufSize = sizeof('\0') + 192 * (_scanCount > AUTOCONNECT_SSIDPAGEUNIT_LINES ? AUTOCONNECT_SSIDPAGEUNIT_LINES : _scanCount);
bufSize += 88 * (_scanCount > AUTOCONNECT_SSIDPAGEUNIT_LINES ? (_scanCount > (AUTOCONNECT_SSIDPAGEUNIT_LINES * 2) ? 2 : 1) : 0); bufSize += 88 * (_scanCount > AUTOCONNECT_SSIDPAGEUNIT_LINES ? (_scanCount > (AUTOCONNECT_SSIDPAGEUNIT_LINES * 2) ? 2 : 1) : 0);
char* ssidList = (char*)malloc(bufSize); char* ssidList = (char*)malloc(bufSize);
if (!ssidList) { if (!ssidList) {

Loading…
Cancel
Save