Fix fuzzer found bug in chunked vector (#27566)

* Fix fuzzer found bug in chunked vector

* Update chunked_vector.h
reviewable/pr27522/r14^2
Craig Tiller 4 years ago committed by GitHub
parent 391f2fc2c7
commit 851517078f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      src/core/lib/gprpp/chunked_vector.h
  2. 79
      test/core/gprpp/chunked_vector_corpora/testcase-5405829431427072

@ -113,7 +113,7 @@ class ChunkedVector {
T* operator->() const { return &*chunk_->data[n_]; }
ForwardIterator& operator++() {
++n_;
if (n_ == chunk_->count) {
while (chunk_ != nullptr && n_ == chunk_->count) {
chunk_ = chunk_->next;
n_ = 0;
}
@ -140,7 +140,7 @@ class ChunkedVector {
const T* operator->() const { return &*chunk_->data[n_]; }
ConstForwardIterator& operator++() {
++n_;
if (n_ == chunk_->count) {
while (chunk_ != nullptr && n_ == chunk_->count) {
chunk_ = chunk_->next;
n_ = 0;
}

@ -0,0 +1,79 @@
actions {
emplace_back {
}
}
actions {
emplace_back {
}
}
actions {
emplace_back {
}
}
actions {
emplace_back {
}
}
actions {
emplace_back {
}
}
actions {
emplace_back {
value: 2
}
}
actions {
emplace_back {
}
}
actions {
emplace_back {
}
}
actions {
emplace_back {
}
}
actions {
emplace_back {
value: 537540660
}
}
actions {
emplace_back {
}
}
actions {
emplace_back {
}
}
actions {
emplace_back {
}
}
actions {
emplace_back {
value: 28929
}
}
actions {
emplace_back {
}
}
actions {
emplace_back {
}
}
actions {
emplace_back {
}
}
actions {
emplace_back {
}
}
actions {
pop_back {
}
}
Loading…
Cancel
Save