Fix crash issue
authorHwankyu Jhun <h.jhun@samsung.com>
Wed, 24 Jan 2024 05:00:11 +0000 (14:00 +0900)
committerHwankyu Jhun <h.jhun@samsung.com>
Wed, 24 Jan 2024 05:15:45 +0000 (14:15 +0900)
Currently, __stack_chk_fail occurs by array accessment.

Change-Id: I7e4aca03777c61b59a640c9a1e1bee8007dbc6e4
Signed-off-by: Hwankyu Jhun <h.jhun@samsung.com>
src/launchpad-process-pool/loader_mount.cc

index 853a6035130619735d40977a0ba167ea7109c256..b31bb1135ba0f2a474f64343e7f8651613b53b6f 100644 (file)
@@ -253,19 +253,19 @@ void LoaderMount::OnExecution() {
 
 
 int LoaderMount::CreatePipe(int (*pipe_fd)[2]) {
-  *pipe_fd[0] = -1;
-  *pipe_fd[1] = -1;
+  (*pipe_fd)[0] = -1;
+  (*pipe_fd)[1] = -1;
 
   if (pipe(*pipe_fd) == -1) {
     _E("pipe() is failed. errno(%d)", errno);
     return -1;
   }
 
-  if (fcntl(*pipe_fd[0], F_SETPIPE_SZ, Socket::kSocketMaxBufferSize) == -1)
-    _E("Failed to set pipe size. errno(%d)", errno);
+  if (fcntl((*pipe_fd)[0], F_SETPIPE_SZ, Socket::kSocketMaxBufferSize) == -1)
+    _E("Failed to set pipe size. pipe_fd(%d), errno(%d)", (*pipe_fd)[0], errno);
 
-  if (fcntl(*pipe_fd[1], F_SETPIPE_SZ, Socket::kSocketMaxBufferSize) == -1)
-    _E("Failed to set pipe size. errno(%d)", errno);
+  if (fcntl((*pipe_fd)[1], F_SETPIPE_SZ, Socket::kSocketMaxBufferSize) == -1)
+    _E("Failed to set pipe size. pipe_fd(%d), errno(%d)", (*pipe_fd)[1], errno);
 
   return 0;
 }