src/base/json/json_reader_unittest.cc
base::StringPiece MakeNotNullTerminatedInput(const char* input,
                                             std::unique_ptr<char[]>* owner) {
  size_t str_len = strlen(input);
  owner->reset(new char[str_len]);
  memcpy(owner->get(), input, str_len);
  return base::StringPiece(owner->get(), str_len);
}
// MSan will do a better job detecting over-read errors if the input is not
// nul-terminated on the heap. This will copy |input| to a new buffer owned by
// |owner|, returning a base::StringPiece to |owner|.
MSan will do a better job detecting over-read errors if the input is not
nul-terminated on the heap.
MSan will do a better job detecting over - read errors if the input is not nul - terminated on the heap .
base::StringPiece MakeNotNullTerminatedInput(const char* input,
                                             std::unique_ptr<char[]>* owner) {
  size_t str_len = strlen(input);
  owner->reset(new char[str_len]);
  memcpy(owner->get(), input, str_len);
  return base::StringPiece(owner->get(), str_len);
}
base :: StringPiece MakeNotNullTerminatedInput ( const char * input , std :: unique_ptr < char [ ] > * owner ) { size_t str_len = strlen ( input ) ; owner -> reset ( new char [ str_len ] ) ; memcpy ( owner -> get ( ) , input , str_len ) ; return base :: StringPiece ( owner -> get ( ) , str_len ) ; }
MSan will do a better job detecting over-read errors if the input is not
nul-terminated on the heap.
MSan will do a better job detecting over - read errors if the input is not nul - terminated on the heap .