diff options
author | Tae-Young Chung <ty83.chung@samsung.com> | 2019-10-02 16:52:46 +0900 |
---|---|---|
committer | Tae-Young Chung <ty83.chung@samsung.com> | 2019-10-02 08:58:22 +0000 |
commit | c9cbca1245d58bdf6175b5a478f613c04f96ec02 (patch) | |
tree | a6e91f4b2489dbc21a9463166ca4ee84205fd59f | |
parent | 226d1299a74b0bc1999107e7137c43c5bdab55bb (diff) | |
download | mediavision-c9cbca1245d58bdf6175b5a478f613c04f96ec02.tar.gz mediavision-c9cbca1245d58bdf6175b5a478f613c04f96ec02.tar.bz2 mediavision-c9cbca1245d58bdf6175b5a478f613c04f96ec02.zip |
Fix NO_CATCH.LIBRARY issue by security checksubmit/tizen/20191007.015232accepted/tizen/unified/20191008.101624
Change-Id: I260628690969a6e75b1515d38df1c66807204ce3
Signed-off-by: Tae-Young Chung <ty83.chung@samsung.com>
-rw-r--r-- | mv_face/face/src/FaceRecognitionModel.cpp | 18 | ||||
-rw-r--r-- | mv_face/face/src/FaceTrackingModel.cpp | 2 |
2 files changed, 12 insertions, 8 deletions
diff --git a/mv_face/face/src/FaceRecognitionModel.cpp b/mv_face/face/src/FaceRecognitionModel.cpp index 0b98930d..1cc519f1 100644 --- a/mv_face/face/src/FaceRecognitionModel.cpp +++ b/mv_face/face/src/FaceRecognitionModel.cpp @@ -217,13 +217,17 @@ int FaceRecognitionModel::save(const std::string& fileName) filePath = fileName; - std::string prefixPath = filePath.substr(0, filePath.find_last_of('/')); - LOGD("prefixPath: %s", prefixPath.c_str()); - - /* check the directory is available */ - if (access(prefixPath.c_str(), F_OK)) { - LOGE("Can't save recognition model. Path[%s] doesn't existed.", prefixPath.c_str()); - + try { + std::string prefixPath = filePath.substr(0, filePath.find_last_of('/')); + LOGD("prefixPath: %s", prefixPath.c_str()); + /* check the directory is available */ + if (access(prefixPath.c_str(), F_OK)) { + LOGE("Can't save recognition model. Path[%s] doesn't exist.", prefixPath.c_str()); + + return MEDIA_VISION_ERROR_INVALID_PATH; + } + } catch (const std::out_of_range& e) { + LOGE("Can't save recognition model. Path[%s] doesn't exist.", filePath.c_str()); return MEDIA_VISION_ERROR_INVALID_PATH; } diff --git a/mv_face/face/src/FaceTrackingModel.cpp b/mv_face/face/src/FaceTrackingModel.cpp index 83f7ff63..778a82e9 100644 --- a/mv_face/face/src/FaceTrackingModel.cpp +++ b/mv_face/face/src/FaceTrackingModel.cpp @@ -82,7 +82,7 @@ int FaceTrackingModel::save(const std::string& fileName) return MEDIA_VISION_ERROR_INVALID_PATH; } - } catch (std::out_of_range& e) { + } catch (const std::out_of_range& e) { LOGE("Can't save tracking model. Path[%s] is invalid.", filePath.c_str()); return MEDIA_VISION_ERROR_INVALID_PATH; } |