From fbe462e1b0769034284522da434ae08e4f9537e2 Mon Sep 17 00:00:00 2001 From: Tobias Brunner Date: Tue, 1 Jul 2014 12:37:25 +0200 Subject: [PATCH] pts: Avoid integer overflow when reading file names in the old IMA format --- src/libpts/pts/pts_ima_event_list.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libpts/pts/pts_ima_event_list.c b/src/libpts/pts/pts_ima_event_list.c index 9959fb3b3..9bff4654b 100644 --- a/src/libpts/pts/pts_ima_event_list.c +++ b/src/libpts/pts/pts_ima_event_list.c @@ -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;