folly: fbvector: ubsan: avoid memset(nullptr, 0, 0)
authorNathan Bronson <ngbronson@fb.com>
Wed, 16 Nov 2016 22:01:49 +0000 (14:01 -0800)
committerFacebook Github Bot <facebook-github-bot-bot@fb.com>
Wed, 16 Nov 2016 22:08:48 +0000 (14:08 -0800)
commit2782b0144f937fc9c6df0a9b21bd4e1c1abbf678
tree61ca2bbbde2bd2a30d8e4c171b54e99ef7aea488
parent77a350d28a77cfae6ef492cfcb9e2b30d05d0444
folly: fbvector: ubsan: avoid memset(nullptr, 0, 0)

Summary:
Constructing an empty FBVector by length results in a call to
memset with a null destination, which is undefined behavior.  This diff
fixes it.

Reviewed By: luciang, meyering, Gownta

Differential Revision: D4191612

fbshipit-source-id: 3dcc091396fc33ac2230bd2d90906325131b0a3b
folly/FBVector.h
folly/test/FBVectorTest.cpp