aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/libstrongswan/integrity_checker.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/libstrongswan/integrity_checker.c b/src/libstrongswan/integrity_checker.c
index 6a402b358..eb0bc1407 100644
--- a/src/libstrongswan/integrity_checker.c
+++ b/src/libstrongswan/integrity_checker.c
@@ -104,7 +104,14 @@ static u_int32_t build_file(private_integrity_checker_t *this, char *file)
*/
static int callback(struct dl_phdr_info *dlpi, size_t size, Dl_info *dli)
{
- if (dli->dli_fbase == (void*)dlpi->dlpi_addr)
+ /* We are looking for the dlpi_addr matching the address of our dladdr().
+ * dl_iterate_phdr() returns such an address for other (unknown) objects
+ * in very rare cases (e.g. in a chrooted gentoo, but only if
+ * the checksum_builder is invoked by 'make'). As a workaround, we filter
+ * objects by dlpi_name; valid objects have a library name.
+ */
+ if (dli->dli_fbase == (void*)dlpi->dlpi_addr &&
+ dlpi->dlpi_name && *dlpi->dlpi_name)
{
int i;