[PATCH] preloader: fix moving of auxiliary values

harald at redhat.com harald at redhat.com
Thu Jul 29 05:02:06 CDT 2010


From: Harald Hoyer <harald at redhat.com>

set_auxiliary_values() did not move all auxiliary values, if the new
list was smaller than the old one, which resulted in not copying
AT_RANDOM. If the glibc was compiled to rely on AT_RANDOM, this resulted
in a segfault in the dynamic loader [1].

[1] https://bugzilla.redhat.com/show_bug.cgi?id=617968
---
 loader/preloader.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/loader/preloader.c b/loader/preloader.c
index 83a5172..2dc2872 100644
--- a/loader/preloader.c
+++ b/loader/preloader.c
@@ -519,7 +519,7 @@ static void set_auxiliary_values( ElfW(auxv_t) *av, const ElfW(auxv_t) *new_av,
     }
     else if (new_count < delete_count)  /* get rid of unused values */
     {
-        int len = (char *)(av + av_count + 1) - dst;
+        int len = (char *)(av + av_count + 1) - src;
         for (i = len - 1; i >= 0; i--) dst[i] = src[i];
     }
     *stack = dst;
-- 
1.7.2




More information about the wine-patches mailing list