chain: Fix allocation size in read_sectors
authorShao Miller <shao.miller@yrdsb.edu.on.ca>
Thu, 24 Jun 2010 15:45:35 +0000 (11:45 -0400)
committerShao Miller <shao.miller@yrdsb.edu.on.ca>
Thu, 24 Jun 2010 15:45:35 +0000 (11:45 -0400)
Oops.  We might allocate more than just one sector.

Signed-off-by: Shao Miller <shao.miller@yrdsb.edu.on.ca>
com32/modules/chain.c

index d5bf4f0..6b0c56a 100644 (file)
@@ -266,7 +266,7 @@ static void *read_sectors(uint64_t lba, uint8_t count)
     if (int13_retry(&inreg, NULL))
        return NULL;
 
-    data = malloc(SECTOR);
+    data = malloc(count * SECTOR);
     if (data)
        memcpy(data, buf, count * SECTOR);
     return data;