Skip to content

Commit

Permalink
crypto: change assertion to condition in bio
Browse files Browse the repository at this point in the history
Read head can be the same as write head, even if there's some data to
read.
  • Loading branch information
indutny committed Jun 19, 2013
1 parent 7373c4d commit bf8dc07
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/node_crypto_bio.cc
Original file line number Diff line number Diff line change
Expand Up @@ -209,8 +209,7 @@ size_t NodeBIO::Read(char* out, size_t size) {
read_head_->write_pos_ = 0;

// But not get beyond write_head_
if (length_ != bytes_read) {
assert(read_head_ != write_head_);
if (length_ != bytes_read && read_head_ != write_head_) {
read_head_ = read_head_->next_;
}
}
Expand Down

0 comments on commit bf8dc07

Please sign in to comment.