You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The JSONMessageStreamingParser in swift-tools-support-core can overflow the stack with large inputs, due to the fact that the parseImpl method is recursive. This can occur with as little as ~3MB of streaming JSON text.
This should be easily reproducible by constructing a JSONMessageStreamingParser and feeding it a large amount of input in a single call to parse().
Clients may pre-split the input on newline (if possible), as a workaround for the overflow.
Additional Detail from JIRA
md5: 59ee1e5911b57c9cb9d9abefc22294f0
Issue Description:
The JSONMessageStreamingParser in swift-tools-support-core can overflow the stack with large inputs, due to the fact that the parseImpl method is recursive. This can occur with as little as ~3MB of streaming JSON text.
This should be easily reproducible by constructing a JSONMessageStreamingParser and feeding it a large amount of input in a single call to parse().
Clients may pre-split the input on newline (if possible), as a workaround for the overflow.
https://github.com/apple/swift-tools-support-core/blob/main/Sources/TSCUtility/JSONMessageStreamingParser.swift
The text was updated successfully, but these errors were encountered: