Skip to content

Comments

BUG: Avoid stackoverflows and memory issues in zod while processing large strings#3880

Closed
klh wants to merge 3 commits intocolinhacks:mainfrom
klh:main
Closed

BUG: Avoid stackoverflows and memory issues in zod while processing large strings#3880
klh wants to merge 3 commits intocolinhacks:mainfrom
klh:main

Conversation

@klh
Copy link

@klh klh commented Dec 4, 2024

This commit will:

  • Add a generalized helper for chunkProcessing in parseUtil
  • Utilize it for base64 string verification

NOTES: there are sure to be other cases when handling large strings that can benefit from this, but i think maintainers should decide where and when.

klh added 3 commits December 4, 2024 13:00
When processing large strings zod will cause overflows and inefficient handling of items - especially base64 strings can be large at times
@netlify
Copy link

netlify bot commented Dec 4, 2024

Deploy Preview for guileless-rolypoly-866f8a ready!

Built without sensitive environment variables

Name Link
🔨 Latest commit 9ac9edd
🔍 Latest deploy log https://app.netlify.com/sites/guileless-rolypoly-866f8a/deploys/6750466d4fd93d0008913fc8
😎 Deploy Preview https://deploy-preview-3880--guileless-rolypoly-866f8a.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@klh klh changed the title Avoid stackoverflows and memory issues in zod while processing large strings BUG: Avoid stackoverflows and memory issues in zod while processing large strings Dec 4, 2024
@klh
Copy link
Author

klh commented Mar 9, 2025

bump on this?

@colinhacks
Copy link
Owner

colinhacks commented May 30, 2025

This is addressed in #4386. With those changes it can handle strings up to the limits of Node.js string length so I believe these concerns are fully addressed 👍 It was a matter of optimizing the regex. Thanks for the PR though!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants