New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 626411 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: Jul 2016
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Windows
Pri: 3
Type: Bug



Sign in to add a comment

V4Store::DebugString has a wchar_t*/char* mismatch

Project Member Reported by brucedaw...@chromium.org, Jul 7 2016

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.

 

Comment 1 by vakh@chromium.org, Jul 7 2016

Status: Started (was: Assigned)
Project Member

Comment 2 by bugdroid1@chromium.org, 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

Comment 3 by vakh@chromium.org, Jul 7 2016

Status: Fixed (was: Started)

Sign in to add a comment