V4Store::DebugString has a wchar_t*/char* mismatch |
||
Issue description
store_path_ is a FilePath and on Windows FilePath::value() returns a wstring, so %s is incorrect for printing it. Therefore this line of code is incorrect on Windows:
return base::StringPrintf("path: %s; state: %s", store_path_.value().c_str(),
state_base64.c_str());
This was found by a /analyze build which gives this warning:
components\safe_browsing_db\v4_store.cc(70) : warning C6303: Format string mismatch: wide character string passed as _Param_(2) when character string is required in call to 'StringPrintf' Actual type: 'const wchar_t *'.
Sorry to be the bearer of bad news :-)
The fix should be tagged with this bug and with 427616.
,
Jul 7 2016
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/31c04917519ee0d0938c9d72c798bc14411bbb31 commit 31c04917519ee0d0938c9d72c798bc14411bbb31 Author: vakh <vakh@chromium.org> Date: Thu Jul 07 22:24:57 2016 Tiny: Fix 626411: Use PRIsFP macro instead of %s for path BUG= 626411 , 543161 , 427616 Review-Url: https://codereview.chromium.org/2126373002 Cr-Commit-Position: refs/heads/master@{#404262} [modify] https://crrev.com/31c04917519ee0d0938c9d72c798bc14411bbb31/components/safe_browsing_db/v4_store.cc
,
Jul 7 2016
|
||
►
Sign in to add a comment |
||
Comment 1 by vakh@chromium.org
, Jul 7 2016