diff options
author | Ilho Kim <ilho159.kim@samsung.com> | 2024-11-18 10:19:23 +0900 |
---|---|---|
committer | Ilho Kim <ilho159.kim@samsung.com> | 2024-11-18 12:43:32 +0900 |
commit | 4a9969ee12bde783fddda0c3bdc5965f9e73a91a (patch) | |
tree | ebc23145c5995e343f883fd2a1773d26d472af0b | |
parent | bf0ddf6a42c08601563ac6f0d569af006705a8a0 (diff) | |
download | slp-pkgmgr-4a9969ee12bde783fddda0c3bdc5965f9e73a91a.tar.gz slp-pkgmgr-4a9969ee12bde783fddda0c3bdc5965f9e73a91a.tar.bz2 slp-pkgmgr-4a9969ee12bde783fddda0c3bdc5965f9e73a91a.zip |
Fix static analysis issue
SEC_DO_NOT_ASSIGN_SIZE_OF_INT
Change-Id: I6a2cd651397d1b278a5f56717266dd10af9899fa
Signed-off-by: Ilho Kim <ilho159.kim@samsung.com>
-rw-r--r-- | installer/pkgmgr_installer_signal_agent.cc | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/installer/pkgmgr_installer_signal_agent.cc b/installer/pkgmgr_installer_signal_agent.cc index 2704f07..84df60a 100644 --- a/installer/pkgmgr_installer_signal_agent.cc +++ b/installer/pkgmgr_installer_signal_agent.cc @@ -85,7 +85,7 @@ static int __create_server_socket(const char* path) { return -1; } - r = bind(fd, (struct sockaddr*)&sa, sizeof(sa)); + r = bind(fd, reinterpret_cast<struct sockaddr*>(&sa), sizeof(sa)); if (r == -1) { LOGE("bind(%s) failed: %d", sa.sun_path, errno); close(fd); @@ -211,7 +211,7 @@ static int __check_authority(int fd) { struct passwd* pwd_r; char buf[PWBUFSIZE]; - len = sizeof(struct ucred); + len = static_cast<socklen_t>(sizeof(struct ucred)); r = getsockopt(fd, SOL_SOCKET, SO_PEERCRED, &cr, &len); if (r != 0) { LOGE("getsockopt failed: %d", errno); @@ -249,14 +249,14 @@ static gboolean __handle_signal(gint fd, unsigned char buf[BUFMAX]; int clifd; struct sockaddr_un sa; - socklen_t s = sizeof(sa); + socklen_t len = static_cast<socklen_t>(sizeof(struct sockaddr_un)); size_t type_len; char* type_name; gsize data_len; gpointer data; GVariant* gv; - clifd = accept(fd, (struct sockaddr*)&sa, &s); + clifd = accept(fd, reinterpret_cast<struct sockaddr*>(&sa), &len); if (clifd == -1) { LOGE("accept failed: %d", errno); return FALSE; |