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: [PATH] [BZ 15674] Fix reading past the array boundary in __memcmp_ssse3


I don't know why the BUF variable is there rather than just using BUF2
directly as you do BUF1.

It seems a little nasty that it repeats the magic number from test-string.h
and relies on it matching for the test to be correct.  If tests are going
to encode the particular values of the BUF[12] fill bytes, then test-string.h
should define macros for the values so we don't repeat the constants.

OTOH, the new test could just memcpy instead of memset to more
straightforwardly ensure the buffers match where they should and don't
where they shouldn't:

	memcpy (buf2, buf1, page_size);
	((char *) buf2)[page_size - 1] ^= 0x11;


Thanks,
Roland


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