summaryrefslogtreecommitdiffstats
path: root/libelf
diff options
context:
space:
mode:
Diffstat (limited to 'libelf')
-rw-r--r--libelf/ChangeLog5
-rw-r--r--libelf/elf32_updatenull.c2
2 files changed, 6 insertions, 1 deletions
diff --git a/libelf/ChangeLog b/libelf/ChangeLog
index f1756301..235b750b 100644
--- a/libelf/ChangeLog
+++ b/libelf/ChangeLog
@@ -1,3 +1,8 @@
+2015-02-07 Jan Kratochvil <[email protected]>
+
+ * elf32_updatenull.c (__elfw2(LIBELFBITS,updatenull_wrlock)): Consider
+ sh_addralign 0 as 1.
+
2015-01-22 Mark Wielaard <[email protected]>
* elf_strptr (elf_strptr): Make sure returned string is NUL
diff --git a/libelf/elf32_updatenull.c b/libelf/elf32_updatenull.c
index be4cea03..5e809b79 100644
--- a/libelf/elf32_updatenull.c
+++ b/libelf/elf32_updatenull.c
@@ -328,7 +328,7 @@ __elfw2(LIBELFBITS,updatenull_wrlock) (Elf *elf, int *change_bop, size_t shnum)
enough for the largest alignment required by a data
block. */
if (unlikely (! powerof2 (shdr->sh_addralign))
- || unlikely (shdr->sh_addralign < sh_align))
+ || unlikely ((shdr->sh_addralign ?: 1) < sh_align))
{
__libelf_seterrno (ELF_E_INVALID_ALIGN);
return -1;