From be9c3bf964295883ff086dfb8c2ece38f833b355 Mon Sep 17 00:00:00 2001 From: Simon Brandner Date: Thu, 6 Dec 2012 10:18:12 +0100 Subject: appended null termination to version string adding closure of socket in syslog_thread and read_socket fixed missing free of filepath in compressed file transfer fixed missing closedir in added in send_one error case fixed missing fclose of src_file in ferror case dlt-daemon.c fixed missing fclose in ferror case dlt_common.c using snprintf for filename instead sprintf in dlt_file_open modified some magix numbers - replaced by limits.h values. added strncpy instead strcpy to make cp more safe. split up a function to avoid coverity complaint when computing size of a write buffer length dlt_daemon_common: added strncpy instead strcpy to make cp more safe. Fixes some more Coverity issues in dlt-daemon.c dlt_user.c dlt_common.c and dlt_offline_trace.c. Conflicts: src/daemon/dlt-daemon.c src/lib/dlt_user.c Signed-off-by: Alexander Wenzel --- src/daemon/dlt-daemon.h | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'src/daemon/dlt-daemon.h') diff --git a/src/daemon/dlt-daemon.h b/src/daemon/dlt-daemon.h index f595e8d..aa8c372 100755 --- a/src/daemon/dlt-daemon.h +++ b/src/daemon/dlt-daemon.h @@ -65,12 +65,16 @@ #ifndef DLT_DAEMON_H #define DLT_DAEMON_H +#include /* for NAME_MAX */ + #include "dlt_daemon_common.h" #include "dlt_user_shared.h" #include "dlt_user_shared_cfg.h" + #include + /** * The flags of a dlt daemon. */ @@ -85,11 +89,11 @@ typedef struct int rflag; /**< (Boolean) Send automatic get log info response during context registration */ int mflag; /**< (Boolean) Sync to serial header on serial connection */ int nflag; /**< (Boolean) Sync to serial header on all TCP connections */ - char evalue[256]; /**< (String: ECU ID) Set ECU ID (Default: ECU1) */ - char bvalue[256]; /**< (String: Baudrate) Serial device baudrate (Default: 115200) */ - char yvalue[256]; /**< (String: Devicename) Additional support for serial device */ - char ivalue[256]; /**< (String: Directory) Directory where to store the persistant configuration (Default: /tmp) */ - char cvalue[256]; /**< (String: Directory) Filename of DLT configuration file (Default: /etc/dlt.conf) */ + char evalue[NAME_MAX + 1]; /**< (String: ECU ID) Set ECU ID (Default: ECU1) */ + char bvalue[NAME_MAX + 1]; /**< (String: Baudrate) Serial device baudrate (Default: 115200) */ + char yvalue[NAME_MAX + 1]; /**< (String: Devicename) Additional support for serial device */ + char ivalue[NAME_MAX + 1]; /**< (String: Directory) Directory where to store the persistant configuration (Default: /tmp) */ + char cvalue[NAME_MAX + 1]; /**< (String: Directory) Filename of DLT configuration file (Default: /etc/dlt.conf) */ int sharedMemorySize; /**< (int) Size of shared memory (Default: 100000) */ int sendMessageTime; /**< (Boolean) Send periodic Message Time if client is connected (Default: 0) */ char offlineTraceDirectory[256]; /**< (String: Directory) Store DLT messages to local directory (Default: /etc/dlt.conf) */ -- cgit v1.2.1