util: kernel: Fix possible vulnerability 41/280941/1 accepted/tizen/unified/20220908.013431
authorDongwoo Lee <dwoo08.lee@samsung.com>
Wed, 7 Sep 2022 03:05:52 +0000 (12:05 +0900)
committerDongwoo Lee <dwoo08.lee@samsung.com>
Wed, 7 Sep 2022 03:05:52 +0000 (12:05 +0900)
Change-Id: I14a31746037d78670418b2b3b615e042b9a6aab4
Signed-off-by: Dongwoo Lee <dwoo08.lee@samsung.com>
src/util/kernel.c

index 996c83d..6259968 100644 (file)
@@ -481,7 +481,10 @@ int kernel_get_thread_group_map_info(struct proc_map_info *map_info,
 
        smaps_fd = fopen(smap_file_path, "r");
        if (!smaps_fd) {
-               _E("failed to open smap: %s", strerror(errno));
+               char errstr[BUFF_MAX];
+
+               strerror_r(errno, errstr, BUFF_MAX);
+               _E("failed to open smap: %s", errstr);
                return -ENOENT;
        }