diff options
author | Justus Winter <justus@gnupg.org> | 2016-04-17 16:36:32 +0200 |
---|---|---|
committer | Justus Winter <justus@gnupg.org> | 2016-04-17 17:08:26 +0200 |
commit | 21ee0e79e90c3cf63613bc1a00a609cfaf1777b2 (patch) | |
tree | 2bd6b7a1bbbd475f0a5a7065fe7b99ad6fd94281 /isofs/pager.c | |
parent | 54ab56a23c472729ba3834f90b01c4406ed358b8 (diff) |
isofs: make superblock detection more robust
* isofs/isofs.h (disk_image_len): New variable.
* isofs/main.c (read_sblock): Avoid out of bounds access.
* isofs/pager.c (disk_image_len): New variable.
(create_disk_pager): Initialize 'disk_image_len'.
Diffstat (limited to 'isofs/pager.c')
-rw-r--r-- | isofs/pager.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/isofs/pager.c b/isofs/pager.c index 35de37e4..b4be4e2d 100644 --- a/isofs/pager.c +++ b/isofs/pager.c @@ -28,6 +28,7 @@ struct port_bucket *pager_bucket; /* Mapped image of the disk */ void *disk_image; +size_t disk_image_len; /* Implement the pager_read_page callback from the pager library. See @@ -148,6 +149,7 @@ create_disk_pager (void) upi->np = 0; pager_bucket = ports_create_bucket (); diskfs_start_disk_pager (upi, pager_bucket, 1, 0, store->size, &disk_image); + disk_image_len = store->size; upi->p = diskfs_disk_pager; } |