fix dangling pointer bug in IPAddressV6
authorTianjiao Yin <ytj@fb.com>
Fri, 19 Feb 2016 18:40:46 +0000 (10:40 -0800)
committerfacebook-github-bot-0 <folly-bot@fb.com>
Fri, 19 Feb 2016 19:20:26 +0000 (11:20 -0800)
commitac31e5f5e80027418cb06a7718b6ade3cacad8bc
tree7fe81cdf38bbd68c2f1ae849c80ebcdb9f3fa2af
parent7bf1835488a101938eb7ec336a3cbeb05384952b
fix dangling pointer bug in IPAddressV6

Summary: `mask(numBits)` returns a temporary variable. After its lifetime ends, subbytes becomes a dangling pointer.

Reviewed By: yfeldblum

Differential Revision: D2953699

fb-gh-sync-id: 5d5a35716ecaa1b3d96edb5a459615756848b92f
shipit-source-id: 5d5a35716ecaa1b3d96edb5a459615756848b92f
folly/IPAddressV6.cpp