summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarc TITINGER <marc.titinger@non.se.com>2021-10-07 16:29:58 +0200
committerSaya Sugiura <39760799+ssugiura@users.noreply.github.com>2021-10-08 09:49:57 +0900
commit9214f892302615beed95222b56065655a40ff2a7 (patch)
tree4e4c6db0f9e132cb1b6671dc79d380218f2885fa
parent1438fcf8c88cd47b20b2984180a8457c3eb9193d (diff)
downloadDLT-daemon-9214f892302615beed95222b56065655a40ff2a7.tar.gz
dlt-system: fix a libc buffer overflow detection on 32bit targets
rather self-exp: 32bits native hint will not hold 8 bits. Signed-off-by: Marc TITINGER <marc.titinger@hotmail.com>
-rw-r--r--src/system/dlt-system-process-handling.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/system/dlt-system-process-handling.c b/src/system/dlt-system-process-handling.c
index 74fed7e..84259cc 100644
--- a/src/system/dlt-system-process-handling.c
+++ b/src/system/dlt-system-process-handling.c
@@ -192,8 +192,8 @@ int register_timer_fd(struct pollfd *pollfd, int fdcnt)
/* Routine for executing LogProcess and LogFile, when timer expires */
void timer_fd_handler(int fd, DltSystemConfiguration *config)
{
- long int timersElapsed = 0;
- int r = read(fd, &timersElapsed, 8); // only needed to reset fd event
+ uint64_t timersElapsed = 0ULL;
+ int r = read(fd, &timersElapsed, 8U); // only needed to reset fd event
if (r < 0)
DLT_LOG(dltsystem, DLT_LOG_ERROR, DLT_STRING("Error while reading timer fd: "),
DLT_STRING(strerror(r)));