summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMichael Methner <mmethner@de.adit-jv.com>2023-01-27 10:51:07 +0100
committerMichael Methner <mmethner@de.adit-jv.com>2023-01-27 10:51:07 +0100
commit8ac9a080bee25e67e49bd138d81c992ce7b6d899 (patch)
tree759285b224735e9eeb4dfde0b5ace9d065619df2 /src
parent198715eb7d606515c1dd22187080cae483480849 (diff)
downloadDLT-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.c2
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;
}