diff options
author | Tobias Brunner <tobias@strongswan.org> | 2014-04-09 17:47:32 +0200 |
---|---|---|
committer | Tobias Brunner <tobias@strongswan.org> | 2014-04-09 17:47:32 +0200 |
commit | f0923ff37764a31dbcb8cb0e58fcaa5cbb35152c (patch) | |
tree | e1ce12de0d3ce6515a150d7fb4c407df11f962ef | |
parent | 8d34e55375a5449624665eca75db82a01b1389ce (diff) | |
download | strongswan-f0923ff37764a31dbcb8cb0e58fcaa5cbb35152c.tar.bz2 strongswan-f0923ff37764a31dbcb8cb0e58fcaa5cbb35152c.tar.xz |
pts: Make sure the complete AIK blob has been read
-rw-r--r-- | src/libpts/pts/pts.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/libpts/pts/pts.c b/src/libpts/pts/pts.c index 8699282f0..3ab9b92e6 100644 --- a/src/libpts/pts/pts.c +++ b/src/libpts/pts/pts.c @@ -393,7 +393,7 @@ static void load_aik_blob(private_pts_t *this) fseek(fp, 0L, SEEK_SET); this->aik_blob = chunk_alloc(aikBlobLen); - if (fread(this->aik_blob.ptr, 1, aikBlobLen, fp)) + if (fread(this->aik_blob.ptr, 1, aikBlobLen, fp) == aikBlobLen) { DBG2(DBG_PTS, "loaded AIK Blob from '%s'", blob_path); DBG3(DBG_PTS, "AIK Blob: %B", &this->aik_blob); @@ -401,6 +401,7 @@ static void load_aik_blob(private_pts_t *this) else { DBG1(DBG_PTS, "unable to read AIK Blob file '%s'", blob_path); + chunk_free(&this->aik_blob); } fclose(fp); return; |