mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2025-09-12 12:30:08 +00:00
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:
@@ -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) {
|
||||
|
Reference in New Issue
Block a user