This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] PPC Bugz#1877 strncmp() accesses beyond instructed nbytes


Ulrich Drepper wrote:
> Beside the previous comment, it is perfectly fine to read beyond the
> end of the string if the read bytes are never uesed and it can never
> cause a segmentation fault.  We do this in the x86 versions all the time.
>
The problem is that where the end of the string is also the end of the
page is can and does result in a segfault (if the next page is
no-access) on powerpc. The existing test-strncmp.c does not test for, or
detect, this case.

So this is a bug in my code that test-strncmp does not but should
detect. So I thought I was doing the right thing by fixing a bug and
improving the test case to detect future bugs on any platform.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]