Fix crash issue 23/304823/1
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:00:11 +0000 (14:00 +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 853a603..b31bb11 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;
 }