From: Tobias Brunner Date: Tue, 1 Jul 2014 10:37:25 +0000 (+0200) Subject: pts: Avoid integer overflow when reading file names in the old IMA format X-Git-Tag: 5.2.0~18 X-Git-Url: http://git.ipfire.org/gitweb/gitweb.cgi?a=commitdiff_plain;h=fbe462e1b0769034284522da434ae08e4f9537e2;p=thirdparty%2Fstrongswan.git pts: Avoid integer overflow when reading file names in the old IMA format --- diff --git a/src/libpts/pts/pts_ima_event_list.c b/src/libpts/pts/pts_ima_event_list.c index 9959fb3b38..9bff4654b8 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;