fix off-by-one error in IPAddress::longestCommonPrefix()
authorAdam Simpkins <simpkins@fb.com>
Fri, 18 Apr 2014 18:53:32 +0000 (11:53 -0700)
committerDave Watson <davejwatson@fb.com>
Tue, 20 May 2014 19:53:46 +0000 (12:53 -0700)
commitdea4e16698c91af1fd112352400017048778fbfd
tree902c2dc683ba93038b38b5ed77823c6c7f6d15c8
parentdced19f55cf70ce7c0b881af5125d95b76321373
fix off-by-one error in IPAddress::longestCommonPrefix()

Summary:
Fix an off-by-one error causing an ASAN abort.  When calling
longestCommonPrefix() with a full mask, it would compare one byte past
the end of the address data, and would end up writing past the end of
the ba array on the stack.

Test Plan:
Built with ASAN, ran the unit tests, and verified the ASAN failure was
gone.

Reviewed By: jasmeetbagga@fb.com

FB internal diff: D1284750
folly/detail/IPAddress.h