From 3c1ef8860d20ea5e5374e9cc9e35befde9ca2635 Mon Sep 17 00:00:00 2001 From: Shao Miller Date: Thu, 24 Jun 2010 11:45:35 -0400 Subject: [PATCH] chain: Fix allocation size in read_sectors Oops. We might allocate more than just one sector. Signed-off-by: Shao Miller --- com32/modules/chain.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/com32/modules/chain.c b/com32/modules/chain.c index d5bf4f0..6b0c56a 100644 --- a/com32/modules/chain.c +++ b/com32/modules/chain.c @@ -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; -- 2.7.4