diff options
author | Jakub Jelinek <jakub@redhat.com> | 2007-01-31 10:45:15 +0000 |
---|---|---|
committer | Jakub Jelinek <jakub@redhat.com> | 2007-01-31 10:45:15 +0000 |
commit | 3687a5a7c5eea2fa08a94e59de164b2e2da3c3e2 (patch) | |
tree | 7686d7a5935ceb8bc2946d01f4c7ccb7fc1a7af7 | |
parent | 1a77d37f9228d51d727f1caff2689137785232b9 (diff) | |
download | glibc-3687a5a7c5eea2fa08a94e59de164b2e2da3c3e2.tar.gz glibc-3687a5a7c5eea2fa08a94e59de164b2e2da3c3e2.tar.xz glibc-3687a5a7c5eea2fa08a94e59de164b2e2da3c3e2.zip |
Do recend check before realigning on strict alignment arches, as otherwise it was comparing a stack address + offset with a mmap address.
-rw-r--r-- | nscd/nscd_getserv_r.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/nscd/nscd_getserv_r.c b/nscd/nscd_getserv_r.c index 86242be7ac..a725b1d3de 100644 --- a/nscd/nscd_getserv_r.c +++ b/nscd/nscd_getserv_r.c @@ -122,6 +122,10 @@ nscd_getserv_r (const char *crit, size_t critlen, const char *proto, retval = -2; goto out; } + if (__builtin_expect ((const char *) aliases_len + + serv_resp.s_aliases_cnt * sizeof (uint32_t) + > recend, 0)) + goto out; #ifndef _STRING_ARCH_unaligned /* The aliases_len array in the mapped database might very @@ -138,10 +142,6 @@ nscd_getserv_r (const char *crit, size_t critlen, const char *proto, * sizeof (uint32_t)); } #endif - if (__builtin_expect ((const char *) aliases_len - + serv_resp.s_aliases_cnt * sizeof (uint32_t) - > recend, 0)) - goto out; } } |