Don't call memcpy with empty buffer in IOBuf::copyBuffer().
authorKyle Nekritz <knekritz@fb.com>
Mon, 27 Feb 2017 18:48:39 +0000 (10:48 -0800)
committerFacebook Github Bot <facebook-github-bot@users.noreply.github.com>
Mon, 27 Feb 2017 18:52:07 +0000 (10:52 -0800)
commitd06839811d31b376d35dd373082ccce21666f44d
treee24cccc5677741a09405fc5763ea8c5af4b9ea12
parentda08e63ce3bac9196b18db82e64db8ecbb44d0ed
Don't call memcpy with empty buffer in IOBuf::copyBuffer().

Summary: Fixes "undefined behavior" in ubsan builds when using an empty ByteRange.

Reviewed By: siyengar

Differential Revision: D4613663

fbshipit-source-id: 4b53ba764609acc986340f10613f84585fa697cf
folly/io/IOBuf.h
folly/io/test/IOBufTest.cpp