Skip to content

Commit

Permalink
tls: tls_wrap causes debug assert in vector
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
kfarnung authored and MylesBorins committed Feb 21, 2018
1 parent e47fd4c commit f3244a1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/tls_wrap.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit f3244a1

Please sign in to comment.