summaryrefslogtreecommitdiffstats
path: root/trunk/src/layout.c
diff options
context:
space:
mode:
Diffstat (limited to 'trunk/src/layout.c')
-rw-r--r--trunk/src/layout.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/trunk/src/layout.c b/trunk/src/layout.c
index 9292425..9e521e1 100644
--- a/trunk/src/layout.c
+++ b/trunk/src/layout.c
@@ -23,6 +23,7 @@
#include <string.h>
#include <time.h>
#include <unistd.h>
+#include <assert.h>
#include "prelinktab.h"
#include "layout.h"
@@ -298,7 +299,10 @@ layout_libs (void)
for (j = 0, k = 0; j < l.binlibs[i]->ndepends; ++j)
if (l.binlibs[i]->depends[j]->type == ET_DYN
&& l.binlibs[i]->depends[j]->done)
- deps[k++] = l.binlibs[i]->depends[j];
+ {
+ assert (k < l.nlibs);
+ deps[k++] = l.binlibs[i]->depends[j];
+ }
if (k)
{
qsort (deps, k, sizeof (struct prelink_entry *), deps_cmp);