aboutsummaryrefslogtreecommitdiffstats
path: root/libinstaller/setadv.c
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@zytor.com>2009-05-14 16:33:37 -0700
committerH. Peter Anvin <hpa@zytor.com>2009-05-14 16:33:37 -0700
commit0046660e3849bef9d922ba69d07c5bc639d1d133 (patch)
tree0d60efb691e622912682b7bab367a51ce8ead76e /libinstaller/setadv.c
parent1c7146a2eeaaf0021cc15e682e12609a652ed870 (diff)
downloadsyslinux-0046660e3849bef9d922ba69d07c5bc639d1d133.tar.gz
syslinux-0046660e3849bef9d922ba69d07c5bc639d1d133.tar.xz
syslinux-0046660e3849bef9d922ba69d07c5bc639d1d133.zip
core: handle more than 32K of code for disk-based derivatives
Handle more than 32K worth of code for disk-based derivatives. We do this by allowing the sector pointers to overflow past sector 1; this is OK because we limit a run to be based on only the pointers that we have read so far. XXX: This is implemented for EXTLINUX, but breaks SYSLINUX. Need to update (and unify!) the SYSLINUX installers to cope. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Diffstat (limited to 'libinstaller/setadv.c')
-rw-r--r--libinstaller/setadv.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/libinstaller/setadv.c b/libinstaller/setadv.c
index c768d1b1..c57f0974 100644
--- a/libinstaller/setadv.c
+++ b/libinstaller/setadv.c
@@ -36,14 +36,14 @@ static void cleanup_adv(unsigned char *advbuf)
uint32_t csum;
/* Make sure both copies agree, and update the checksum */
- set_32(advbuf, ADV_MAGIC1);
+ set_32((uint32_t *)advbuf, ADV_MAGIC1);
csum = ADV_MAGIC2;
for (i = 8; i < ADV_SIZE-4; i += 4)
- csum -= get_32(advbuf+i);
+ csum -= get_32((uint32_t *)(advbuf+i));
- set_32(advbuf+4, csum);
- set_32(advbuf+ADV_SIZE-4, ADV_MAGIC3);
+ set_32((uint32_t *)(advbuf+4), csum);
+ set_32((uint32_t *)(advbuf+ADV_SIZE-4), ADV_MAGIC3);
memcpy(advbuf+ADV_SIZE, advbuf, ADV_SIZE);
}
@@ -130,12 +130,13 @@ static int adv_consistent(const unsigned char *p)
int i;
uint32_t csum;
- if (get_32(p) != ADV_MAGIC1 || get_32(p+ADV_SIZE-4) != ADV_MAGIC3)
+ if (get_32((uint32_t *)p) != ADV_MAGIC1 ||
+ get_32((uint32_t *)(p+ADV_SIZE-4)) != ADV_MAGIC3)
return 0;
csum = 0;
for (i = 4; i < ADV_SIZE-4; i += 4)
- csum += get_32(p+i);
+ csum += get_32((uint32_t *)(p+i));
return csum == ADV_MAGIC2;
}