diff options
author | Fedor Indutny <fedor.indutny@gmail.com> | 2013-06-11 16:11:48 +0200 |
---|---|---|
committer | Fedor Indutny <fedor.indutny@gmail.com> | 2013-06-15 21:43:24 +0200 |
commit | 5dd155a3bb04f84389d5544363407a3b0bfc8e2e (patch) | |
tree | 55351c83499dc2a3befcb5e4efe43174a9fa4e45 /src/node_crypto_bio.cc | |
parent | 4536b27ac1b71e92b26c5d4ba772ae8511db09eb (diff) | |
download | android-node-v8-5dd155a3bb04f84389d5544363407a3b0bfc8e2e.tar.gz android-node-v8-5dd155a3bb04f84389d5544363407a3b0bfc8e2e.tar.bz2 android-node-v8-5dd155a3bb04f84389d5544363407a3b0bfc8e2e.zip |
crypto: ensure that read head is always non-empty
Diffstat (limited to 'src/node_crypto_bio.cc')
-rw-r--r-- | src/node_crypto_bio.cc | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/node_crypto_bio.cc b/src/node_crypto_bio.cc index 9d566fd6f3..547c711488 100644 --- a/src/node_crypto_bio.cc +++ b/src/node_crypto_bio.cc @@ -203,8 +203,10 @@ size_t NodeBIO::Read(char* out, size_t size) { read_head_->write_pos_ = 0; // But not get beyond write_head_ - if (bytes_read != expected) + if (length_ != bytes_read) { + assert(read_head_ != write_head_); read_head_ = read_head_->next_; + } } } assert(expected == bytes_read); |