Fix hpack parser fuzzer failure.

Fix crash when nullptr is passed to ManagedMemorySlice::Equals().
pull/20056/head
Arjun Roy 6 years ago
parent 8c400bc456
commit 6e159d3ee3
  1. 2
      src/core/lib/slice/slice_utils.h

@ -108,7 +108,7 @@ struct ManagedMemorySlice : public grpc_slice {
return !grpc_slice_differs_refcounted(other, *this);
}
bool Equals(const char* buf, const size_t len) const {
return data.refcounted.length == len &&
return data.refcounted.length == len && buf != nullptr &&
memcmp(buf, data.refcounted.bytes, len) == 0;
}
};

Loading…
Cancel
Save