+18
-0
@@ -69,2 +69,5 @@ ;(function (sax) { | ||
| parser.looseCase = parser.opt.lowercase ? 'toLowerCase' : 'toUpperCase' | ||
| parser.opt.maxEntityCount = parser.opt.maxEntityCount || 512 | ||
| parser.opt.maxEntityDepth = parser.opt.maxEntityDepth || 4 | ||
| parser.entityCount = parser.entityDepth = 0 | ||
| parser.tags = [] | ||
@@ -1615,5 +1618,20 @@ parser.closed = parser.closedRoot = parser.sawRoot = false | ||
| ) { | ||
| if ((parser.entityCount += 1) > parser.opt.maxEntityCount) { | ||
| error( | ||
| parser, | ||
| 'Parsed entity count exceeds max entity count' | ||
| ) | ||
| } | ||
| if ((parser.entityDepth += 1) > parser.opt.maxEntityDepth) { | ||
| error( | ||
| parser, | ||
| 'Parsed entity depth exceeds max entity depth' | ||
| ) | ||
| } | ||
| parser.entity = '' | ||
| parser.state = returnState | ||
| parser.write(parsedEntity) | ||
| parser.entityDepth -= 1 | ||
| } else { | ||
@@ -1620,0 +1638,0 @@ parser[buffer] += parsedEntity |
+1
-1
@@ -5,3 +5,3 @@ { | ||
| "author": "Isaac Z. Schlueter <i@izs.me> (http://blog.izs.me/)", | ||
| "version": "1.4.4", | ||
| "version": "1.5.0", | ||
| "main": "lib/sax.js", | ||
@@ -8,0 +8,0 @@ "license": "BlueOak-1.0.0", |
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
57118
1.17%1589
1.02%