From: Rafal Walczyna Date: Wed, 28 Mar 2018 06:45:53 +0000 (+0200) Subject: [common] Fix coverity issue number 112263 X-Git-Tag: submit/tizen/20180403.060641~2^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F16%2F174116%2F1;p=platform%2Fcore%2Fapi%2Fwebapi-plugins.git [common] Fix coverity issue number 112263 [Verification] Build successful Change-Id: I858c6f6cf34174d1f3efadfbdb688fb0bc04ae8d Signed-off-by: Rafal Walczyna --- diff --git a/src/common/filesystem/filesystem_storage.h b/src/common/filesystem/filesystem_storage.h index 8ff78282..fd5dc178 100644 --- a/src/common/filesystem/filesystem_storage.h +++ b/src/common/filesystem/filesystem_storage.h @@ -79,6 +79,7 @@ class Storage : public VirtualRoot { int id() const { return id_; } + private: int id_; }; diff --git a/src/common/tools.cc b/src/common/tools.cc index 5ef95ca1..fd4a2f30 100644 --- a/src/common/tools.cc +++ b/src/common/tools.cc @@ -515,8 +515,7 @@ PlatformResult CheckStorageAccess(const std::string& path) { SCOPE_EXIT { free(real_path); }; - if ((nullptr == real_path && EACCES == errno) || - (-1 == stat(real_path, &buf) && EACCES == errno)) { + if ((nullptr == real_path || -1 == stat(real_path, &buf)) && (EACCES == errno)) { LoggerE("The application does not have necessary privilege to access given file: [%s]", path.c_str()); return PlatformResult(ErrorCode::SECURITY_ERR, @@ -532,8 +531,7 @@ TizenResult CheckStorageAccessAndReturn(const std::string& path) { SCOPE_EXIT { free(real_path); }; - if ((nullptr == real_path && EACCES == errno) || - (-1 == stat(real_path, &buf) && EACCES == errno)) { + if ((nullptr == real_path || -1 == stat(real_path, &buf)) && (EACCES == errno)) { LoggerE("The application does not have necessary privilege to access given file: [%s]", path.c_str()); return SecurityError("Permission denied: accessing files requires proper storage privilege");