Skip to content

Commit 0642a21

Browse files
Merge pull request #437 from michael-methner/master
Check for negative index in dlt_file_message
2 parents 73e1275 + 8ac9a08 commit 0642a21

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/shared/dlt_common.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -1718,7 +1718,7 @@ DltReturnValue dlt_file_message(DltFile *file, int index, int verbose)
17181718
return DLT_RETURN_WRONG_PARAMETER;
17191719

17201720
/* check if message is in range */
1721-
if (index >= file->counter) {
1721+
if (index < 0 || index >= file->counter) {
17221722
dlt_vlog(LOG_WARNING, "Message %d out of range!\r\n", index);
17231723
return DLT_RETURN_WRONG_PARAMETER;
17241724
}

0 commit comments

Comments
 (0)