]> sourceware.org Git - glibc.git/commit
ia64: Fix memchr for large input sizes (BZ #22603)
authorAdhemerval Zanella <adhemerval.zanella@linaro.org>
Thu, 14 Dec 2017 11:05:46 +0000 (09:05 -0200)
committerAdhemerval Zanella <adhemerval.zanella@linaro.org>
Tue, 19 Dec 2017 14:02:36 +0000 (12:02 -0200)
commit3bb1ef58b989012f8199b82af6ec136da2f9fda3
treed889f9c9f475b0941cf558ede5af73d5cefebc1b
parent554e3d51efdd7d15c15876b80a7cba3ad9b6a738
ia64: Fix memchr for large input sizes (BZ #22603)

Current optimized ia64 memchr uses a strategy to check for last address
by adding the input one with expected size.  However it does not take
care for possible overflow.

It was triggered by 3038145ca23 where default rawmemchr now uses memchr
(p, c, (size_t)-1).

This patch fixes it by implement a satured addition where overflows
sets the maximum pointer size to UINTPTR_MAX.

Checked on ia64-linux-gnu where it fixes both stratcliff and
test-rawmemchr failures.

Adhemerval Zanella  <adhemerval.zanella@linaro.org>
James Clarke <jrtc27@jrtc27.com>

[BZ #22603]
* sysdeps/ia64/memchr.S (__memchr): Avoid overflow in pointer
addition.
ChangeLog
sysdeps/ia64/memchr.S
This page took 0.043665 seconds and 5 git commands to generate.