diff --git a/browser_patches/firefox/juggler/pipe/nsRemoteDebuggingPipe.cpp b/browser_patches/firefox/juggler/pipe/nsRemoteDebuggingPipe.cpp index abcb0a758fac1..2b4d5eca48655 100644 --- a/browser_patches/firefox/juggler/pipe/nsRemoteDebuggingPipe.cpp +++ b/browser_patches/firefox/juggler/pipe/nsRemoteDebuggingPipe.cpp @@ -182,10 +182,14 @@ void nsRemoteDebuggingPipe::ReaderLoop() { ++end; start = end; } - if (start != 0 && start < line.size()) { - memmove(line.data(), line.data() + start, line.size() - start); + if (start != 0) { + if (start < line.size()) { + memmove(line.data(), line.data() + start, line.size() - start); + line.resize(line.size() - start); + } else { + line.clear(); + } } - line.resize(line.size() - start); } }