[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[tyndur-devel] [PATCH] iso9660: Pufferueberlauf bei nicht ausgerichtetem Zugriff



! iso9660: Wenn man mitten in einem Cacheblock zu lesen anfaengt, darf
  man nicht mehr den ganzen Block kopieren, sondern nur bis zu Ende des
  Blocks.

Signed-off-by: Kevin Wolf <kevin@xxxxxxxxxx>
---
 src/modules/cdi/iso9660/sector.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/src/modules/cdi/iso9660/sector.c b/src/modules/cdi/iso9660/sector.c
index 5e765ea..b14a795 100644
--- a/src/modules/cdi/iso9660/sector.c
+++ b/src/modules/cdi/iso9660/sector.c
@@ -66,7 +66,7 @@ size_t iso9660_read(struct iso9660_fs_res *res,size_t pos,size_t size,void *buff
         break;
     }
 
-    cur_size = MIN(rem_size, res->voldesc->sector_size);
+    cur_size = MIN(rem_size, res->voldesc->sector_size - offset);
 
     memcpy(buffer,cache_block->data+offset,cur_size);
     cdi_cache_block_release(res->cache,cache_block);
-- 
1.6.0.2