tools: acrn-crashlog: remove unsafe strlen in common

Remove strlen in common apis, and change their caller if necessary.

Tracked-On: #1254
Signed-off-by: Liu, Xinwu <xinwu.liu@intel.com>
Reviewed-by: Yonghua Huang <yonghua.huang@intel.com>
Acked-by: Chen Gang <gang.c.chen@intel.com>
This commit is contained in:
Liu, Xinwu
2018-09-27 14:00:34 +08:00
committed by Xie, Nanlin
parent f25bc50e68
commit 40dbdcde4f
14 changed files with 378 additions and 461 deletions

View File

@@ -129,12 +129,11 @@ static int get_backtrace(int pid, int fd, int sig, const char *comm)
return -1;
}
}
membkt = exec_out2mem(GET_GDB_INFO, format);
if (!membkt) {
len = exec_out2mem(&membkt, GET_GDB_INFO, format);
if (len <= 0) {
LOGE("get gdb info failed\n");
return -1;
}
len = strlen(membkt);
ret = write(fd, membkt, len);
free(membkt);
if (ret != len) {