tls: tls_wrap causes debug assert in vector

When using a debug build (on Windows specifically) the error case for
tls_wrap causes an assert to fire because the index being passed is
outside the bounds of the vector.

The fix is to switch to iterators.

PR-URL: https://github.com/nodejs/node/pull/18830
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Minwoo Jung <minwoo@nodesource.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
This commit is contained in:
Kyle Farnung authored and Myles Borins committed 2018-02-21 18:12:36 -05:00
1 parent 9957916c26
commit f8f1423e7a
1 file changed
+2 -2
+2 -2
View File
@@ -518,8 +518,8 @@ bool TLSWrap::ClearIn() {
// This can be skipped in the error case because no further writes
// would succeed anyway.
pending_cleartext_input_.insert(pending_cleartext_input_.end(),
&buffers[i],
&buffers[buffers.size()]);
buffers.begin() + i,
buffers.end());
}
return false;