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

This commit is contained in:
Tobias Brunner
2014-07-01 17:58:36 +02:00
parent ecb55b4639
commit fbe462e1b0
+1 -1
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;