diff options
author | Sandy <39258624+sandy-lcq@users.noreply.github.com> | 2022-10-26 16:36:27 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-10-26 10:36:27 +0200 |
commit | 394b38195b0ba33f329c715eb0c0c1c7b3884227 (patch) | |
tree | 20bee9dbf4cd00802323c9c2c8e3c85a0ea34f43 | |
parent | 71b131daf2c13477470289cc8faef319e2ff5f2f (diff) | |
download | DLT-daemon-394b38195b0ba33f329c715eb0c0c1c7b3884227.tar.gz |
dlt-system: Fix buffer overflow detection on 32bit targets (#398)
* dlt-system: Fix buffer overflow detection on 32bit targets
On 32bit target, dlt-system will termiated with error:
dlt-system: *** buffer overflow detected ***: terminated
Signed-off-by: Changqing Li <changqing.li@windriver.com>
* Fixed newline at EOF
Signed-off-by: Changqing Li <changqing.li@windriver.com>
Co-authored-by: michael-methner <mmethner@de.adit-jv.com>
-rw-r--r-- | src/system/dlt-system-watchdog.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/system/dlt-system-watchdog.c b/src/system/dlt-system-watchdog.c index a2b01de..cfb5b76 100644 --- a/src/system/dlt-system-watchdog.c +++ b/src/system/dlt-system-watchdog.c @@ -109,8 +109,8 @@ int register_watchdog_fd(struct pollfd *pollfd, int fdcnt) void watchdog_fd_handler(int fd) { - 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(watchdogContext, DLT_LOG_ERROR, DLT_STRING("Could not reset systemd watchdog. Exit with: "), DLT_STRING(strerror(r))); @@ -120,4 +120,5 @@ void watchdog_fd_handler(int fd) DLT_LOG(watchdogContext, DLT_LOG_DEBUG, DLT_STRING("systemd watchdog waited periodic\n")); } -#endif
\ No newline at end of file +#endif + |