This is the mail archive of the newlib@sourceware.org mailing list for the newlib 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]

[PATCH, AARCH64] Fix memchr when buffer size is 0


A slightly obscure corner-case bug has come to light with the memchr
code that I published recently.  If the buffer size is 0, then the code
could return the wrong result.  Furthermore, in that case, it is unsafe
to dereference memory at all.

The fix is trivial, but adds a branch to the critical path: there's not
much we can do about that.

Applied.

2014-08-19  Richard Earnshaw  <rearnsha@arm.com>

	* libc/machine/aarch64/memchr.S: Add check for zero-sized buffer.

Attachment: memchr-zero.patch
Description: Text document


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