Fix buffer size used on read() system call 33/154433/3
authorSangyoon Jang <jeremy.jang@samsung.com>
Tue, 10 Oct 2017 07:50:28 +0000 (16:50 +0900)
committerSangyoon Jang <jeremy.jang@samsung.com>
Wed, 11 Oct 2017 10:54:45 +0000 (10:54 +0000)
Change-Id: Ib5cea6ca00cbcd621685b203426603f66c9920be
Signed-off-by: Sangyoon Jang <jeremy.jang@samsung.com>
plugin/app2sd/server/app2sd_internals_utils.c

index f7bbd9e..623a4e9 100644 (file)
@@ -322,7 +322,7 @@ char *_app2sd_execute_command(const char *argv[])
        default:
                /* parent */
                close(my_pipe[1]);
-               result = read(my_pipe[0], buf, FILENAME_MAX);
+               result = read(my_pipe[0], buf, sizeof(buf) - 1);
                if (result < 0) {
                        strerror_r(errno, err_buf, sizeof(err_buf));
                        fprintf(stderr, "read failed %d..%s\n", errno, err_buf);