net-snmp 3.5.7 → 3.5.8

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.
Files changed (3) hide show
  1. package/README.md +4 -0
  2. package/index.js +8 -6
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -3162,6 +3162,10 @@ Example programs are included under the module's `example` directory.
3162
3162
 
3163
3163
  * Fix handing of null varbinds in walk
3164
3164
 
3165
+ ## Version 3.5.8 - 24/11/2021
3166
+
3167
+ * Fix processing of negative integers larger than 32 bits
3168
+
3165
3169
  # License
3166
3170
 
3167
3171
  Copyright (c) 2020 Mark Abrahams <mark@abrahams.co.nz>
package/index.js CHANGED
@@ -427,14 +427,16 @@ function readUint (buffer, isSigned) {
427
427
  value *= 256;
428
428
  value += buffer.readByte ();
429
429
 
430
- if (isSigned && i <= 0) {
431
- if ((value & 0x80) == 0x80)
432
- signedBitSet = true;
433
- }
430
+ if (isSigned && i <= 0) {
431
+ if ((value & 0x80) == 0x80) {
432
+ signedBitSet = true;
433
+ }
434
+ }
434
435
  }
435
436
 
436
- if (signedBitSet)
437
- value -= (1 << (i * 8));
437
+ if (signedBitSet) {
438
+ value -= 2 ** (i * 8);
439
+ }
438
440
 
439
441
  return value;
440
442
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "net-snmp",
3
- "version": "3.5.7",
3
+ "version": "3.5.8",
4
4
  "description": "JavaScript implementation of the Simple Network Management Protocol (SNMP)",
5
5
  "main": "index.js",
6
6
  "directories": {