From: Christopher Dykes Date: Mon, 18 Jul 2016 16:56:55 +0000 (-0700) Subject: Make static analysis happy about the length of patternBuf X-Git-Tag: 2016.07.26~37 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=9c4ce90b8ec73dff15b5540d3f2dc2c06092390e;p=folly.git Make static analysis happy about the length of patternBuf Summary: The static analysis doesn't quite understand that we are assigning a NUL to, at most, `patternBuf[MAX_PATH + 1]` so increase the buffer size slightly to make it happy. Reviewed By: yfeldblum Differential Revision: D3571923 fbshipit-source-id: c027e2b253dc3e56d13e9a15a0e960a6aa3a0e6c --- diff --git a/folly/portability/Dirent.cpp b/folly/portability/Dirent.cpp index 5c75a200..5c01eb82 100755 --- a/folly/portability/Dirent.cpp +++ b/folly/portability/Dirent.cpp @@ -34,7 +34,7 @@ struct DIR { } DIR* open() { - wchar_t patternBuf[MAX_PATH + 2]; + wchar_t patternBuf[MAX_PATH + 3]; size_t len; if (mbstowcs_s(&len, patternBuf, MAX_PATH, pattern.c_str(), MAX_PATH - 2)) {