Commit b168f451 authored by Wez Furlong's avatar Wez Furlong Committed by Facebook Github Bot

folly: fix IOBufCursorTest

Summary:
```
folly/folly/io/test/IOBufCursorTest.cpp:212:3:
folly/folly/io/Cursor.h:411:13: error: ‘void* memcpy(void*, const void
*, size_t)’ forming offset [13, 20] is out of the bounds [0, 12] of object ‘buf’ with type ‘char [12]’ [-Werror=array-bounds]
       memcpy(buf, data(), len);
       ~~~~~~^~~~~~~~~~~~~~~~~~
```

Reviewed By: yfeldblum

Differential Revision: D14702563

fbshipit-source-id: 3697a021d71bccfae9d8833b42a0c25e916b7a78
parent c6ad789e
......@@ -203,7 +203,7 @@ TEST(IOBuf, PullAndPeek) {
EXPECT_EQ(3, iobuf1->countChainElements());
EXPECT_EQ(11, iobuf1->computeChainDataLength());
char buf[12];
char buf[20];
memset(buf, 0, sizeof(buf));
Cursor(iobuf1.get()).pull(buf, 11);
EXPECT_EQ("hello world", std::string(buf));
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment