From: YoungHun Kim Date: Mon, 18 Nov 2024 01:46:18 +0000 (+0900) Subject: Fix Svace issue of LIB.BAD_LOAD_PATH and LIB.INSECURE_STRNCMP X-Git-Tag: accepted/tizen/unified/20241118.155148^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F03%2F320503%2F2;p=platform%2Fcore%2Fmultimedia%2Frscmgr-service.git Fix Svace issue of LIB.BAD_LOAD_PATH and LIB.INSECURE_STRNCMP Change-Id: I0a1f753dde472241bd7474d7da3b1ef7038d71c3 --- diff --git a/packaging/rscmgr-service.spec b/packaging/rscmgr-service.spec index 7fe386e..90e4bab 100644 --- a/packaging/rscmgr-service.spec +++ b/packaging/rscmgr-service.spec @@ -1,7 +1,7 @@ Name: rscmgr-service Summary: Daemon for resource manager Version: 0.1 -Release: 11 +Release: 12 Group: Multimedia/Libraries License: Apache-2.0 Source0: %{name}-%{version}.tar.gz diff --git a/src/CResourceService.cpp b/src/CResourceService.cpp index 3b2b140..5e0eff7 100644 --- a/src/CResourceService.cpp +++ b/src/CResourceService.cpp @@ -31,8 +31,9 @@ #include #define RM_SERVER_SMART_DEADLOCK_WATCHDOG_TIME_90_SEC 90 -#define RM_SERVER_WATCHDOG_TIME_10000_MSEC 10000 +#define RM_SERVER_WATCHDOG_TIME_10000_MSEC 10000 #define RM_SERVER_INVALID_TABLE_TIME_30000_MSEC 30000 +#define RESOURCED_LIB_PATH LIBDIR "/libproc-stat.so.5" int CResourceService::Init(GMainLoop *main_loop) { @@ -96,7 +97,7 @@ void CResourceService::SetVIPProcess(void) void *handle; void (*vip_func)(void); - handle = dlopen("/lib/libproc-stat.so.5", RTLD_LAZY); + handle = dlopen(RESOURCED_LIB_PATH, RTLD_LAZY); if (!handle) { SERVER_ERR("failed to open libproc-stat.so (%s)", dlerror()); diff --git a/src/gen_rm_msgq.cpp b/src/gen_rm_msgq.cpp index 03d806f..ef72a8b 100644 --- a/src/gen_rm_msgq.cpp +++ b/src/gen_rm_msgq.cpp @@ -63,7 +63,7 @@ static int _is_realpath(const char *path) goto out; } - if (strncmp(path, rms_realpath, len_path)) { + if (strncmp(path, rms_realpath, len_path + 1)) { SERVER_ERR("path mismatch(%s:%s)", path, rms_realpath); result = 0; goto out;