From 2d3dc13f481bd6a5dfc16511f7df89903b69c4fd Mon Sep 17 00:00:00 2001 From: Alexander Wenzel Date: Wed, 26 Mar 2014 16:42:26 +0100 Subject: Fixed: all possible malloc, sprintf and strcpy problems Signed-off-by: Alexander Wenzel --- src/daemon/dlt_daemon_client.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'src/daemon/dlt_daemon_client.c') diff --git a/src/daemon/dlt_daemon_client.c b/src/daemon/dlt_daemon_client.c index 936c462..5f85b15 100644 --- a/src/daemon/dlt_daemon_client.c +++ b/src/daemon/dlt_daemon_client.c @@ -719,7 +719,7 @@ void dlt_daemon_control_get_log_info(int sock, DltDaemon *daemon, DltDaemonLocal if (verbose) { - sprintf(str,"Allocate %d bytes for response msg databuffer\n", resp.datasize); + snprintf(str,DLT_DAEMON_TEXTBUFSIZE,"Allocate %d bytes for response msg databuffer\n", resp.datasize); dlt_log(LOG_INFO, str); } @@ -753,7 +753,7 @@ void dlt_daemon_control_get_log_info(int sock, DltDaemon *daemon, DltDaemonLocal offset+=sizeof(uint16_t); #if (DLT_DEBUG_GETLOGINFO==1) - sprintf(str,"#apid: %d \n", count_app_ids); + snprintf(str,DLT_DAEMON_TEXTBUFSIZE,"#apid: %d \n", count_app_ids); dlt_log(LOG_DEBUG, str); #endif @@ -792,7 +792,7 @@ void dlt_daemon_control_get_log_info(int sock, DltDaemon *daemon, DltDaemonLocal #if (DLT_DEBUG_GETLOGINFO==1) dlt_print_id(buf, apid); - sprintf(str,"apid: %s\n",buf); + snprintf(str,DLT_DAEMON_TEXTBUFSIZE,"apid: %s\n",buf); dlt_log(LOG_DEBUG, str); #endif @@ -809,14 +809,14 @@ void dlt_daemon_control_get_log_info(int sock, DltDaemon *daemon, DltDaemonLocal offset+=sizeof(uint16_t); #if (DLT_DEBUG_GETLOGINFO==1) - sprintf(str,"#ctid: %d \n", count_con_ids); + snprintf(str,DLT_DAEMON_TEXTBUFSIZE,"#ctid: %d \n", count_con_ids); dlt_log(LOG_DEBUG, str); #endif for (j=0;japid[0]!='\0') && (req->ctid[0]!='\0'))) @@ -836,7 +836,7 @@ void dlt_daemon_control_get_log_info(int sock, DltDaemon *daemon, DltDaemonLocal #if (DLT_DEBUG_GETLOGINFO==1) dlt_print_id(buf, context->ctid); - sprintf(str,"ctid: %s \n",buf); + snprintf(str,DLT_DAEMON_TEXTBUFSIZE,"ctid: %s \n",buf); dlt_log(LOG_DEBUG, str); #endif @@ -876,7 +876,7 @@ void dlt_daemon_control_get_log_info(int sock, DltDaemon *daemon, DltDaemonLocal } #if (DLT_DEBUG_GETLOGINFO==1) - sprintf(str,"ll=%d ts=%d \n",(int32_t)ll,(int32_t)ts); + snprintf(str,DLT_DAEMON_TEXTBUFSIZE,"ll=%d ts=%d \n",(int32_t)ll,(int32_t)ts); dlt_log(LOG_DEBUG, str); #endif } -- cgit v1.2.1