Skip to content

Commit de0ed84

Browse files
committed
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: #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>
1 parent 28f3ffb commit de0ed84

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/tls_wrap.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -491,8 +491,8 @@ bool TLSWrap::ClearIn() {
491491
// This can be skipped in the error case because no further writes
492492
// would succeed anyway.
493493
pending_cleartext_input_.insert(pending_cleartext_input_.end(),
494-
&buffers[i],
495-
&buffers[buffers.size()]);
494+
buffers.begin() + i,
495+
buffers.end());
496496
}
497497

498498
return false;

0 commit comments

Comments
 (0)