mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2026-06-07 17:46:15 +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:
@@ -14,10 +14,11 @@
|
||||
#include <sys/cdefs.h>
|
||||
|
||||
#define RESERVED_SOCKET_PREFIX "/tmp/"
|
||||
#define SOCKET_PATH_MAX 128
|
||||
|
||||
int linux_get_control_socket(const char *name);
|
||||
int create_socket_server(const char *name, int type);
|
||||
|
||||
int socket_local_client(const char *name, int type);
|
||||
int socket_local_client(const char *name, const size_t len, int type);
|
||||
ssize_t send_fd(int sockfd, const void *data, size_t len, int fd);
|
||||
ssize_t recv_fd(int sockfd, void *data, size_t len, int *out_fd);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user