SVACE: Fix SIGN_EXTENSION (WGID 16564) 82/297182/1 accepted/tizen_8.0_unified tizen_8.0 accepted/tizen/8.0/unified/20231005.100145 accepted/tizen/unified/20230814.121032 tizen_8.0_m2_release
authorDongkyun Son <dongkyun.s@samsung.com>
Fri, 11 Aug 2023 08:08:28 +0000 (17:08 +0900)
committerDongkyun Son <dongkyun.s@samsung.com>
Fri, 11 Aug 2023 08:11:37 +0000 (17:11 +0900)
WID:3704077 Unsafe conversion of expression 'timestamp' with type
'unsigned int' to implementation defined type '__time_t' may or may not
override sign-bit depending on size of implementation defined type,
which may cause unexpected results on porting to different platforms

http://10.240.209.78:12000/v2/warning/warningListView#PRJID=2&WGID=16564

Change-Id: I5bbcfd9c719ba0f31b87155487fe091bfef49a58
Signed-off-by: Dongkyun Son <dongkyun.s@samsung.com>
src/file_sync_service.c

index f179a61..fe3c7ad 100755 (executable)
@@ -377,8 +377,8 @@ static int handle_send_file(int s, int noti_fd, char *path, mode_t mode, char *b
     if(fd >= 0) {
         struct utimbuf u;
         sdb_close(fd);
-        u.actime = timestamp;
-        u.modtime = timestamp;
+        u.actime = (time_t)timestamp;
+        u.modtime = (time_t)timestamp;
         utime(path, &u);
 
         msg.status.id = ID_OKAY;