systeminformation 5.21.8 → 5.21.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/docker.js CHANGED
@@ -462,7 +462,8 @@ function dockerContainerStats(containerIDs, callback) {
462
462
  if (containerIDsSanitized !== '*') {
463
463
  containerIDsSanitized = '';
464
464
  const s = (util.isPrototypePolluted() ? '' : util.sanitizeShellString(containerIDs, true)).trim();
465
- for (let i = 0; i <= util.mathMin(s.length, 2000); i++) {
465
+ const l = util.mathMin(s.length, 2000);
466
+ for (let i = 0; i <= l; i++) {
466
467
  if (s[i] !== undefined) {
467
468
  s[i].__proto__.toLowerCase = util.stringToLower;
468
469
  const sl = s[i].toLowerCase();
package/lib/internet.js CHANGED
@@ -13,7 +13,6 @@
13
13
  // 12. Internet
14
14
  // ----------------------------------------------------------------------------------
15
15
 
16
- // const exec = require('child_process').exec;
17
16
  const util = require('./util');
18
17
 
19
18
  let _platform = process.platform;
@@ -45,7 +44,8 @@ function inetChecksite(url, callback) {
45
44
  }
46
45
  let urlSanitized = '';
47
46
  const s = util.sanitizeShellString(url, true);
48
- for (let i = 0; i <= util.mathMin(s.length, 2000); i++) {
47
+ const l = util.mathMin(s.length, 2000);
48
+ for (let i = 0; i <= l; i++) {
49
49
  if (s[i] !== undefined) {
50
50
  s[i].__proto__.toLowerCase = util.stringToLower;
51
51
  const sl = s[i].toLowerCase();
@@ -143,7 +143,8 @@ function inetLatency(host, callback) {
143
143
  }
144
144
  let hostSanitized = '';
145
145
  const s = (util.isPrototypePolluted() ? '8.8.8.8' : util.sanitizeShellString(host, true)).trim();
146
- for (let i = 0; i <= util.mathMin(s.length, 2000); i++) {
146
+ const l = util.mathMin(s.length, 2000);
147
+ for (let i = 0; i <= l; i++) {
147
148
  if (!(s[i] === undefined)) {
148
149
  s[i].__proto__.toLowerCase = util.stringToLower;
149
150
  const sl = s[i].toLowerCase();
package/lib/network.js CHANGED
@@ -745,7 +745,8 @@ function networkInterfaces(callback, rescan, defaultString) {
745
745
 
746
746
  let ifaceSanitized = '';
747
747
  const s = util.isPrototypePolluted() ? '---' : util.sanitizeShellString(nic.iface);
748
- for (let i = 0; i <= util.mathMin(s.length, 2000); i++) {
748
+ const l = util.mathMin(s.length, 2000);
749
+ for (let i = 0; i <= l; i++) {
749
750
  if (s[i] !== undefined) {
750
751
  ifaceSanitized = ifaceSanitized + s[i];
751
752
  }
@@ -840,7 +841,8 @@ function networkInterfaces(callback, rescan, defaultString) {
840
841
  let iface = dev.split(':')[0].trim().toLowerCase();
841
842
  let ifaceSanitized = '';
842
843
  const s = util.isPrototypePolluted() ? '---' : util.sanitizeShellString(iface);
843
- for (let i = 0; i <= util.mathMin(s.length, 2000); i++) {
844
+ const l = util.mathMin(s.length, 2000);
845
+ for (let i = 0; i <= l; i++) {
844
846
  if (s[i] !== undefined) {
845
847
  ifaceSanitized = ifaceSanitized + s[i];
846
848
  }
@@ -973,7 +975,8 @@ function networkInterfaces(callback, rescan, defaultString) {
973
975
 
974
976
  let ifaceSanitized = '';
975
977
  const s = util.isPrototypePolluted() ? '---' : util.sanitizeShellString(dev);
976
- for (let i = 0; i <= util.mathMin(s.length, 2000); i++) {
978
+ const l = util.mathMin(s.length, 2000);
979
+ for (let i = 0; i <= l; i++) {
977
980
  if (s[i] !== undefined) {
978
981
  ifaceSanitized = ifaceSanitized + s[i];
979
982
  }
@@ -1221,7 +1224,8 @@ function networkStatsSingle(iface) {
1221
1224
  process.nextTick(() => {
1222
1225
  let ifaceSanitized = '';
1223
1226
  const s = util.isPrototypePolluted() ? '---' : util.sanitizeShellString(iface);
1224
- for (let i = 0; i <= util.mathMin(s.length, 2000); i++) {
1227
+ const l = util.mathMin(s.length, 2000);
1228
+ for (let i = 0; i <= l; i++) {
1225
1229
  if (s[i] !== undefined) {
1226
1230
  ifaceSanitized = ifaceSanitized + s[i];
1227
1231
  }
package/lib/processes.js CHANGED
@@ -131,7 +131,8 @@ function services(srv, callback) {
131
131
  srvString.__proto__.trim = util.stringTrim;
132
132
 
133
133
  const s = util.sanitizeShellString(srv);
134
- for (let i = 0; i <= util.mathMin(s.length, 2000); i++) {
134
+ const l = util.mathMin(s.length, 2000);
135
+ for (let i = 0; i <= l; i++) {
135
136
  if (s[i] !== undefined) {
136
137
  srvString = srvString + s[i];
137
138
  }
@@ -986,7 +987,9 @@ function processLoad(proc, callback) {
986
987
  processesString.__proto__.trim = util.stringTrim;
987
988
 
988
989
  const s = util.sanitizeShellString(proc);
989
- for (let i = 0; i <= util.mathMin(s.length, 2000); i++) {
990
+ const l = util.mathMin(s.length, 2000);
991
+
992
+ for (let i = 0; i <= l; i++) {
990
993
  if (s[i] !== undefined) {
991
994
  processesString = processesString + s[i];
992
995
  }
package/lib/util.js CHANGED
@@ -682,7 +682,8 @@ function sanitizeShellString(str, strict) {
682
682
  if (typeof strict === 'undefined') { strict = false; }
683
683
  const s = str || '';
684
684
  let result = '';
685
- for (let i = 0; i <= mathMin(s.length, 2000); i++) {
685
+ const l = mathMin(s.length, 2000);
686
+ for (let i = 0; i <= l; i++) {
686
687
  if (!(s[i] === undefined ||
687
688
  s[i] === '>' ||
688
689
  s[i] === '<' ||
package/lib/wifi.js CHANGED
@@ -366,8 +366,12 @@ function parseWifiDarwin(wifiObj) {
366
366
  });
367
367
  }
368
368
  }
369
- if (wifiItem.SSID) {
370
- ssid = Buffer.from(wifiItem.SSID, 'base64').toString('utf8');
369
+ if (wifiItem.SSID && ssid === '') {
370
+ try {
371
+ ssid = Buffer.from(wifiItem.SSID, 'base64').toString('utf8');
372
+ } catch (err) {
373
+ util.noop();
374
+ }
371
375
  }
372
376
  result.push({
373
377
  ssid,
@@ -403,7 +407,9 @@ function wifiNetworks(callback) {
403
407
  if (iface) {
404
408
  let ifaceSanitized = '';
405
409
  const s = util.isPrototypePolluted() ? '---' : util.sanitizeShellString(iface, true);
406
- for (let i = 0; i <= util.mathMin(s.length, 2000); i++) {
410
+ const l = util.mathMin(s.length, 2000);
411
+
412
+ for (let i = 0; i <= l; i++) {
407
413
  if (s[i] !== undefined) {
408
414
  ifaceSanitized = ifaceSanitized + s[i];
409
415
  }
@@ -539,7 +545,9 @@ function wifiConnections(callback) {
539
545
  ifaces.forEach(ifaceDetail => {
540
546
  let ifaceSanitized = '';
541
547
  const s = util.isPrototypePolluted() ? '---' : util.sanitizeShellString(ifaceDetail.iface, true);
542
- for (let i = 0; i <= util.mathMin(s.length, 2000); i++) {
548
+ const ll = util.mathMin(s.length, 2000);
549
+
550
+ for (let i = 0; i <= ll; i++) {
543
551
  if (s[i] !== undefined) {
544
552
  ifaceSanitized = ifaceSanitized + s[i];
545
553
  }
@@ -551,7 +559,8 @@ function wifiConnections(callback) {
551
559
  const network = networkList.filter(nw => nw.ssid === ssid);
552
560
  let ssidSanitized = '';
553
561
  const t = util.isPrototypePolluted() ? '---' : util.sanitizeShellString(ssid, true);
554
- for (let i = 0; i <= util.mathMin(t.length, 2000); i++) {
562
+ const l = util.mathMin(t.length, 2000);
563
+ for (let i = 0; i <= l; i++) {
555
564
  if (t[i] !== undefined) {
556
565
  ssidSanitized = ssidSanitized + t[i];
557
566
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "systeminformation",
3
- "version": "5.21.8",
3
+ "version": "5.21.10",
4
4
  "description": "Advanced, lightweight system and OS information library",
5
5
  "license": "MIT",
6
6
  "author": "Sebastian Hildebrandt <hildebrandt@plus-innovations.com> (https://plus-innovations.com)",