@@ -401,7 +401,15 @@ function wifiNetworks(callback) {
401
401
}
402
402
} ) ;
403
403
if ( iface ) {
404
- const res = getWifiNetworkListIw ( iface ) ;
404
+ let ifaceSanitized = '' ;
405
+ const s = util . isPrototypePolluted ( ) ? '---' : util . sanitizeShellString ( iface ) ;
406
+ for ( let i = 0 ; i <= util . mathMin ( s . length , 2000 ) ; i ++ ) {
407
+ if ( s [ i ] !== undefined ) {
408
+ ifaceSanitized = ifaceSanitized + s [ i ] ;
409
+ }
410
+ }
411
+
412
+ const res = getWifiNetworkListIw ( ifaceSanitized ) ;
405
413
if ( res === - 1 ) {
406
414
// try again after 4 secs
407
415
setTimeout ( function ( iface ) {
@@ -529,8 +537,16 @@ function wifiConnections(callback) {
529
537
const ifaces = ifaceListLinux ( ) ;
530
538
const networkList = getWifiNetworkListNmi ( ) ;
531
539
ifaces . forEach ( ifaceDetail => {
532
- const nmiDetails = nmiDeviceLinux ( ifaceDetail . iface ) ;
533
- const wpaDetails = wpaConnectionLinux ( ifaceDetail . iface ) ;
540
+ let ifaceSanitized = '' ;
541
+ const s = util . isPrototypePolluted ( ) ? '---' : util . sanitizeShellString ( ifaceDetail . iface ) ;
542
+ for ( let i = 0 ; i <= util . mathMin ( s . length , 2000 ) ; i ++ ) {
543
+ if ( s [ i ] !== undefined ) {
544
+ ifaceSanitized = ifaceSanitized + s [ i ] ;
545
+ }
546
+ }
547
+
548
+ const nmiDetails = nmiDeviceLinux ( ifaceSanitized ) ;
549
+ const wpaDetails = wpaConnectionLinux ( ifaceSanitized ) ;
534
550
const ssid = nmiDetails . ssid || wpaDetails . ssid ;
535
551
const network = networkList . filter ( nw => nw . ssid === ssid ) ;
536
552
const nmiConnection = nmiConnectionLinux ( ssid ) ;
0 commit comments