Skip to content

Commit

Permalink
Do recend check before realigning on strict alignment arches, as othe…
Browse files Browse the repository at this point in the history
…rwise it was comparing a stack address + offset with a mmap address.
  • Loading branch information
Jakub Jelinek committed Jan 31, 2007
1 parent 1a77d37 commit 3687a5a
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions nscd/nscd_getserv_r.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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;
}
}

Expand Down

0 comments on commit 3687a5a

Please sign in to comment.