diff options
author | Shao Miller <shao.miller@yrdsb.edu.on.ca> | 2011-08-29 20:21:09 -0400 |
---|---|---|
committer | Paulo Alcantara <pcacjr@gmail.com> | 2011-09-11 04:09:59 +0000 |
commit | d782f2a2aec66486a62d41dbd4bca3b95fa295a8 (patch) | |
tree | 15921bbb500e2267ed4d233e835daf9bec74c7ed | |
parent | 8edf44b7fb1a4f29029b93c63285c4431358bbe1 (diff) | |
download | syslinux-d782f2a2aec66486a62d41dbd4bca3b95fa295a8.tar.gz |
win: Fix an out-of-bounds array access
We should not attempt to make a map of more LDLINUX.SYS
sectors than we have. Simply multiplying a cluster count
times the number of sectors per cluster does not account
for unused sectors in the last used cluster.
Signed-off-by: Shao Miller <shao.miller@yrdsb.edu.on.ca>
Signed-off-by: Paulo Alcantara <pcacjr@gmail.com>
-rw-r--r-- | win/syslinux.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/win/syslinux.c b/win/syslinux.c index 13f25b6d..26e5a278 100644 --- a/win/syslinux.c +++ b/win/syslinux.c @@ -409,7 +409,7 @@ int main(int argc, char *argv[]) len.QuadPart = ((extent.NextVcn.QuadPart - extent.FirstVcn.QuadPart) * vol_info.SectorsPerCluster); - while (len.QuadPart--) { + while (len.QuadPart-- && nsectors < ldlinux_sectors) { *secp++ = lba.QuadPart++; nsectors++; } |