1
0
mirror of https://sourceware.org/git/glibc.git synced 2025-07-28 00:21:52 +03:00

Fix strncmp page test to limit length to size of object

This commit is contained in:
Andreas Schwab
2011-03-29 10:40:28 +02:00
parent 8cb700c0f3
commit e513f34605
2 changed files with 9 additions and 3 deletions

View File

@ -204,6 +204,7 @@ do_page_test (size_t offset1, size_t offset2, char *s2)
{
char *s1;
int exp_result;
size_t max_offset = offset1 > offset2 ? offset1 : offset2;
if (offset1 >= page_size || offset2 >= page_size)
return;
@ -211,12 +212,12 @@ do_page_test (size_t offset1, size_t offset2, char *s2)
s1 = (char *) (buf1 + offset1);
s2 += offset2;
exp_result= *s1;
exp_result = *s1;
FOR_EACH_IMPL (impl, 0)
{
check_result (impl, s1, s2, page_size, -exp_result);
check_result (impl, s2, s1, page_size, exp_result);
check_result (impl, s1, s2, page_size - max_offset, -exp_result);
check_result (impl, s2, s1, page_size - max_offset, exp_result);
}
}