Skip to content

Commit f3244a1

Browse files
kfarnungMylesBorins
authored andcommitted
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 <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Minwoo Jung <[email protected]> Reviewed-By: Colin Ihrig <[email protected]>
1 parent e47fd4c commit f3244a1

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/tls_wrap.cc

+2-2
Original file line numberDiff line numberDiff line change
@@ -518,8 +518,8 @@ bool TLSWrap::ClearIn() {
518518
// This can be skipped in the error case because no further writes
519519
// would succeed anyway.
520520
pending_cleartext_input_.insert(pending_cleartext_input_.end(),
521-
&buffers[i],
522-
&buffers[buffers.size()]);
521+
buffers.begin() + i,
522+
buffers.end());
523523
}
524524

525525
return false;

0 commit comments

Comments
 (0)