diff options
author | Michael Methner <mmethner@de.adit-jv.com> | 2023-01-27 10:51:07 +0100 |
---|---|---|
committer | Michael Methner <mmethner@de.adit-jv.com> | 2023-01-27 10:51:07 +0100 |
commit | 8ac9a080bee25e67e49bd138d81c992ce7b6d899 (patch) | |
tree | 759285b224735e9eeb4dfde0b5ace9d065619df2 /src | |
parent | 198715eb7d606515c1dd22187080cae483480849 (diff) | |
download | DLT-daemon-8ac9a080bee25e67e49bd138d81c992ce7b6d899.tar.gz |
Check for negative index in dlt_file_message
Fixes #436
Signed-off-by: Michael Methner <mmethner@de.adit-jv.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/shared/dlt_common.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/shared/dlt_common.c b/src/shared/dlt_common.c index 6737251..97766f7 100644 --- a/src/shared/dlt_common.c +++ b/src/shared/dlt_common.c @@ -1718,7 +1718,7 @@ DltReturnValue dlt_file_message(DltFile *file, int index, int verbose) return DLT_RETURN_WRONG_PARAMETER; /* check if message is in range */ - if (index >= file->counter) { + if (index < 0 || index >= file->counter) { dlt_vlog(LOG_WARNING, "Message %d out of range!\r\n", index); return DLT_RETURN_WRONG_PARAMETER; } |