mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2026-06-09 02:24:45 +00:00
tools: acrn-crashlog: remove unsafe apis from android_events.c
1. Refine strings operation. 2. Remove sscanf, sprintf and strlen. 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:
@@ -319,6 +319,20 @@ struct log_t *get_log_by_name(char *name)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
struct vm_t *get_vm_by_name(const char *name)
|
||||
{
|
||||
int id;
|
||||
struct vm_t *vm;
|
||||
|
||||
for_each_vm(id, vm, conf) {
|
||||
if (!vm)
|
||||
continue;
|
||||
if (strcmp(name, vm->name) == 0)
|
||||
return vm;
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
int crash_depth(struct crash_t *tcrash)
|
||||
{
|
||||
int id;
|
||||
|
||||
Reference in New Issue
Block a user