diff options
author | brucedawson <brucedawson@chromium.org> | 2014-12-08 10:26:50 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2014-12-08 18:27:16 +0000 |
commit | 251dd9b09e9b20233d88d59edae33159fdee3a5a (patch) | |
tree | cbf35a466cebe4b939efe60df5697e3f1d45cd65 /cloud_print/virtual_driver/win | |
parent | 7a211357b0874cfa58909af6510affdb0340b7c6 (diff) | |
download | chromium_src-251dd9b09e9b20233d88d59edae33159fdee3a5a.zip chromium_src-251dd9b09e9b20233d88d59edae33159fdee3a5a.tar.gz chromium_src-251dd9b09e9b20233d88d59edae33159fdee3a5a.tar.bz2 |
Fixing error checking of PathService::Get.
The return value of PathService::Get was being checked with the FAILED()
macro which is intended for use with HRESULT return types. Because
PathService::Get returns a bool and FAILED treats all non-negative
numbers as success, failures will never be detected.
This was found by VC++'s /analyze which said:
src\cloud_print\virtual_driver\win\install\setup.cc(510) : warning C6215:
Cast between semantically different integer types: a Boolean type to
HRESULT.
The original bug was introduced
by https://chromiumcodereview.appspot.com/11876005
BUG=427616
Review URL: https://codereview.chromium.org/740463006
Cr-Commit-Position: refs/heads/master@{#307280}
Diffstat (limited to 'cloud_print/virtual_driver/win')
-rw-r--r-- | cloud_print/virtual_driver/win/install/setup.cc | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/cloud_print/virtual_driver/win/install/setup.cc b/cloud_print/virtual_driver/win/install/setup.cc index ad51a8e..f4d0c4d 100644 --- a/cloud_print/virtual_driver/win/install/setup.cc +++ b/cloud_print/virtual_driver/win/install/setup.cc @@ -507,7 +507,7 @@ HRESULT ExecuteCommands() { *base::CommandLine::ForCurrentProcess(); base::FilePath exe_path; - if (FAILED(PathService::Get(base::DIR_EXE, &exe_path)) || + if (!PathService::Get(base::DIR_EXE, &exe_path) || !base::DirectoryExists(exe_path)) { return HRESULT_FROM_WIN32(ERROR_PATH_NOT_FOUND); } |