summaryrefslogtreecommitdiff
path: root/include/dlt/dlt_common.h
diff options
context:
space:
mode:
authorLassi Marttala <lassi.lm.marttala@partner.bmw.com>2012-02-21 12:16:23 +0100
committerChristian Muck <christian.muck@bmw.de>2012-04-04 14:30:09 +0200
commit64646a665c9fafc4454c67b6212702ed59e01c87 (patch)
tree510bc41181cfd9a0edd71325c3d1b3dcf52aa570 /include/dlt/dlt_common.h
parent83059468ecd8ca6a68901f20477615cb58808c94 (diff)
downloadDLT-daemon-64646a665c9fafc4454c67b6212702ed59e01c87.tar.gz
GENDLT-15, Avoid buffer overrun with snprintf().
Check return value of dlt_user_log_write_start(_id) correctly. Reduce the number of applications if allocation fails. Make dlt_user_log_write_start inline Improve error checking in dlt_user_log_write_start_id Use databuffersize to avoid reallocations Signed-off-by: Christian Muck <christian.muck@bmw.de>
Diffstat (limited to 'include/dlt/dlt_common.h')
-rwxr-xr-xinclude/dlt/dlt_common.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/include/dlt/dlt_common.h b/include/dlt/dlt_common.h
index 686df19..19ee4d5 100755
--- a/include/dlt/dlt_common.h
+++ b/include/dlt/dlt_common.h
@@ -200,7 +200,7 @@
\
if(_verbose) \
{ \
- sprintf(_strbuf, "%s()\n",__func__); \
+ snprintf(_strbuf, 255, "%s()\n",__func__); \
dlt_log(LOG_INFO, _strbuf); \
} \
}
@@ -376,6 +376,7 @@ typedef struct sDltMessage
uint8_t headerbuffer[sizeof(DltStorageHeader)+
sizeof(DltStandardHeader)+sizeof(DltStandardHeaderExtra)+sizeof(DltExtendedHeader)]; /**< buffer for loading complete header */
uint8_t *databuffer; /**< buffer for loading payload */
+ int32_t databuffersize;
/* header values of current loaded message */
DltStorageHeader *storageheader; /**< pointer to storage header of current loaded header */