From: Shao Miller Date: Thu, 24 Jun 2010 15:45:35 +0000 (-0400) Subject: chain: Fix allocation size in read_sectors X-Git-Tag: syslinux-4.00-pre61~1^2~6 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=3c1ef8860d20ea5e5374e9cc9e35befde9ca2635;p=profile%2Fivi%2Fsyslinux.git chain: Fix allocation size in read_sectors Oops. We might allocate more than just one sector. Signed-off-by: Shao Miller --- 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;