Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion src/responses/parser.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,13 @@ class Parser extends EventEmitter {
return;
}

if (ber.remain < ber.length) {
// If ber.length == 0, then we do not have a complete chunk
// and can't proceed with parsing.
// Allowing this function to continue results in an infinite loop
// and due to the recursive nature of this function quickly
// hits the stack call size limit.
// This only happens with very large responses.
if (ber.remain < ber.length || ber.length === 0) {
return;
}

Expand Down