mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2026-06-07 09:41:30 +00:00
tools: acrn-crashlog: remove unsafe apis in usercrash
Since strlen/vsnprintf/ato* api are not safe, so use strnlen instead of strlen, use vasprintf instead of vsnprintf and use strtol instead of atoi. Tracked-On: #1254 Signed-off-by: xiaojin2 <xiaojing.liu@intel.com> Reviewed-by: Huang Yonghua <yonghua.huang@intel.com> Reviewed-by: Liu, Xinwu <xinwu.liu@intel.com> Acked-by: Chen Gang <gang.c.chen@intel.com>
This commit is contained in:
@@ -53,7 +53,7 @@ int main(int argc, char *argv[])
|
||||
|
||||
if (argc == 2) {
|
||||
/* it's from shell cmd */
|
||||
pid = atoi(argv[1]);
|
||||
pid = (int)strtol(argv[1], NULL, 10);
|
||||
crash_dump(pid, 0, STDOUT_FILENO);
|
||||
} else {
|
||||
print_usage();
|
||||
|
||||
Reference in New Issue
Block a user