pts: Avoid integer overflow when reading file names in the old IMA format

This commit is contained in:
Tobias Brunner 2014-07-01 12:37:25 +02:00
parent ecb55b4639
commit fbe462e1b0
1 changed files with 1 additions and 1 deletions

View File

@ -298,7 +298,7 @@ pts_ima_event_list_t* pts_ima_event_list_create(char *file)
}
/* read the 32 bit length of the file name in host order */
if (read(fd, &name_len, 4) != 4)
if (read(fd, &name_len, 4) != 4 || name_len == UINT32_MAX)
{
error = "invalid filename field length";
break;