net-snmp 3.9.3 → 3.9.4

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/README.md CHANGED
@@ -3289,6 +3289,10 @@ Example programs are included under the module's `example` directory.
3289
3289
 
3290
3290
  * Add AgentX subagent "error" and "close" events
3291
3291
 
3292
+ ## Version 3.9.4 - 26/05/2023
3293
+
3294
+ * Fix syntax constraints tokenization and fix applying of size constraints
3295
+
3292
3296
  # License
3293
3297
 
3294
3298
  Copyright (c) 2020 Mark Abrahams <mark@abrahams.co.nz>
package/index.js CHANGED
@@ -3392,7 +3392,7 @@ ModuleStore.getConstraintsFromSyntax = function (syntax) {
3392
3392
  syntax = Object.keys(syntax)[0];
3393
3393
  } else if ( firstSyntaxKey.sizes ) {
3394
3394
  constraints = {
3395
- size: firstSyntaxKey.sizes
3395
+ sizes: firstSyntaxKey.sizes
3396
3396
  };
3397
3397
  syntax = Object.keys(syntax)[0];
3398
3398
  } else {
@@ -3553,7 +3553,7 @@ MibNode.prototype.setValue = function (newValue) {
3553
3553
  }
3554
3554
  } else if ( constraints.sizes ) {
3555
3555
  // if size is constrained, value must have a length property
3556
- if ( ! ( "length" in newValue ) ) {
3556
+ if ( newValue.length === undefined ) {
3557
3557
  return false;
3558
3558
  }
3559
3559
  len = newValue.length;
package/lib/mib.js CHANGED
@@ -167,14 +167,15 @@ var MIB = function (dir) {
167
167
  case '(':
168
168
  if ( ! this.CharBuffer.isComment && ! this.CharBuffer.isString ) {
169
169
  this.CharBuffer.nested++;
170
- if ( char == '(') {
170
+ if (char == '(' || char == '{') {
171
+ // Emit the previous token if this is the start of an outer group
172
+ if (this.CharBuffer.nested === 1) {
173
+ this.CharBuffer.Fill(FileName, row, column);
174
+ }
171
175
  this.CharBuffer.inGroup++;
172
176
  }
173
177
  }
174
- if (this.CharBuffer.builder == 'INTEGER') {
175
- this.CharBuffer.Fill(FileName, row, column);
176
- this.CharBuffer.Append(char);
177
- } else if (this.CharBuffer.isComment || ((this.CharBuffer.isOID || this.CharBuffer.nested > 0) && (!this.CharBuffer.isList || this.CharBuffer.inGroup > 0))) {
178
+ if (this.CharBuffer.isComment || ((this.CharBuffer.isOID || this.CharBuffer.nested > 0) && (!this.CharBuffer.isList || this.CharBuffer.inGroup > 0))) {
178
179
  this.CharBuffer.Append(char);
179
180
  } else {
180
181
  this.CharBuffer.Fill(FileName, row, column);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "net-snmp",
3
- "version": "3.9.3",
3
+ "version": "3.9.4",
4
4
  "description": "JavaScript implementation of the Simple Network Management Protocol (SNMP)",
5
5
  "main": "index.js",
6
6
  "directories": {