Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Wildcards] RangeError: Maximum call stack size exceeded #1205

Closed
modestaspruckus opened this issue Jan 18, 2023 · 2 comments
Closed

[Wildcards] RangeError: Maximum call stack size exceeded #1205

modestaspruckus opened this issue Jan 18, 2023 · 2 comments
Labels

Comments

@modestaspruckus
Copy link

modestaspruckus commented Jan 18, 2023

Describe the bug

When escaping payload fields with wildcard *, it throws error:

RangeError: Maximum call stack size exceeded
    at Array.slice (<anonymous>)
    at /Users/modestaspruckus/projects/backend/node_modules/express-validator/src/select-fields.js:44:14
    at Array.map (<anonymous>)
    at expandPath (/Users/modestaspruckus/projects/backend/node_modules/express-validator/src/select-fields.js:42:14)
    at /Users/modestaspruckus/projects/backend/node_modules/express-validator/src/select-fields.js:50:13
    at Array.forEach (<anonymous>)
    at expandPath (/Users/modestaspruckus/projects/backend/node_modules/express-validator/src/select-fields.js:49:14)
    at /Users/modestaspruckus/projects/backend/node_modules/express-validator/src/select-fields.js:50:13
    at Array.forEach (<anonymous>)
    at expandPath (/Users/modestaspruckus/projects/backend/node_modules/express-validator/src/select-fields.js:49:14)
    at /Users/modestaspruckus/projects/backend/node_modules/express-validator/src/select-fields.js:50:13
    at Array.forEach (<anonymous>)
    at expandPath (/Users/modestaspruckus/projects/backend/node_modules/express-validator/src/select-fields.js:49:14)
    at /Users/modestaspruckus/projects/backend/node_modules/express-validator/src/select-fields.js:50:13
    at Array.forEach (<anonymous>)
    at expandPath (/Users/modestaspruckus/projects/backend/node_modules/express-validator/src/select-fields.js:49:14)

To Reproduce

  1. Go to https://runkit.com/modestaspruckus/63c7f7aacca97c00089cd8b6
  2. Click on run

Expected behavior

No error

Current behavior

Throws RangeError: Maximum call stack size exceeded

Environment:

  • Express-validator version: 6.14.0
  • Express version: 4.18.2
  • Node.js version: 16.17.1
@gustavohenke
Copy link
Member

Thanks! I've reproduced it and will work on a fix.

@gustavohenke
Copy link
Member

Fix published v6.14.3.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants