* grub-core/kern/dl.c: Don't discard const attribute.

This commit is contained in:
Vladimir Serbinenko 2013-12-21 13:26:27 +01:00
parent 2f9c48041a
commit 05126706b0
2 changed files with 7 additions and 3 deletions

View file

@ -1,3 +1,7 @@
2013-12-21 Vladimir Serbinenko <phcoder@gmail.com>
* grub-core/kern/dl.c: Don't discard const attribute.
2013-12-21 Vladimir Serbinenko <phcoder@gmail.com> 2013-12-21 Vladimir Serbinenko <phcoder@gmail.com>
* grub-core/kern/disk.c: Fix potential overflow. * grub-core/kern/disk.c: Fix potential overflow.

View file

@ -223,7 +223,7 @@ static grub_err_t
grub_dl_load_segments (grub_dl_t mod, const Elf_Ehdr *e) grub_dl_load_segments (grub_dl_t mod, const Elf_Ehdr *e)
{ {
unsigned i; unsigned i;
Elf_Shdr *s; const Elf_Shdr *s;
grub_size_t tsize = 0, talign = 1; grub_size_t tsize = 0, talign = 1;
#if !defined (__i386__) && !defined (__x86_64__) #if !defined (__i386__) && !defined (__x86_64__)
grub_size_t tramp; grub_size_t tramp;
@ -232,9 +232,9 @@ grub_dl_load_segments (grub_dl_t mod, const Elf_Ehdr *e)
#endif #endif
char *ptr; char *ptr;
for (i = 0, s = (Elf_Shdr *)((char *) e + e->e_shoff); for (i = 0, s = (const Elf_Shdr *)((const char *) e + e->e_shoff);
i < e->e_shnum; i < e->e_shnum;
i++, s = (Elf_Shdr *)((char *) s + e->e_shentsize)) i++, s = (const Elf_Shdr *)((const char *) s + e->e_shentsize))
{ {
tsize = ALIGN_UP (tsize, s->sh_addralign) + s->sh_size; tsize = ALIGN_UP (tsize, s->sh_addralign) + s->sh_size;
if (talign < s->sh_addralign) if (talign < s->sh_addralign)