aboutsummaryrefslogtreecommitdiffstats
path: root/src/exec.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/exec.c')
-rw-r--r--src/exec.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/exec.c b/src/exec.c
index 4f56629..ca7fd14 100644
--- a/src/exec.c
+++ b/src/exec.c
@@ -1122,6 +1122,15 @@ error_out:
goto error_out;
if (set_dynamic (dso, DT_GNU_CONFLICTSZ, dso->shdr[i].sh_size, 1))
goto error_out;
+ /* Check if we're going to run over the next section */
+ if (dso->shdr[i].sh_offset
+ + (dso->shdr[i].sh_type == SHT_NOBITS
+ ? 0 : dso->shdr[i].sh_size) > dso->shdr[i+1].sh_offset)
+ {
+ error (0, ENOMEM, "%s: Could not create .gnu.conflict section [overwrites next section]",
+ dso->filename);
+ goto error_out;
+ }
}
if (undo != -1)