@bobfrankston/iflow-direct 0.1.48 → 0.1.49

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 (2) hide show
  1. package/imap-protocol.js +10 -0
  2. package/package.json +1 -1
package/imap-protocol.js CHANGED
@@ -422,6 +422,16 @@ function tokenizeParenList(s) {
422
422
  let j = i;
423
423
  while (j < end && str[j] !== " " && str[j] !== ")" && str[j] !== "(")
424
424
  j++;
425
+ if (j === i) {
426
+ // str[i] is a stray ')' (or '(') that none of the branches
427
+ // above consumed — an unbalanced/malformed parenthesised
428
+ // list (Dovecot mis-parses some Outlook `From:` headers and
429
+ // emits exactly this). Without advancing, `i` is stuck and
430
+ // the while-loop spins FOREVER, pinning a CPU core and
431
+ // wedging the whole daemon event loop. Skip the stray char.
432
+ i++;
433
+ continue;
434
+ }
425
435
  tokens.push(str.substring(i, j));
426
436
  i = j;
427
437
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bobfrankston/iflow-direct",
3
- "version": "0.1.48",
3
+ "version": "0.1.49",
4
4
  "description": "Direct IMAP client — transport-agnostic, no Node.js dependencies, browser-ready",
5
5
  "main": "index.js",
6
6
  "types": "index.ts",