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: nodejs#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 MayaLekova committed May 8, 2018
1 parent 877fdf7 commit e85ae12
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 @@ -491,8 +491,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 e85ae12

Please sign in to comment.