mirror of
git://gcc.gnu.org/git/gcc.git
synced 2025-01-25 06:33:59 +08:00
re PR libstdc++/66354 ([UBSAN] stl_algobase.h:708:7: runtime error: null pointer passed as argument)
PR libstdc++/66354 * include/bits/stl_algobase.h (__fill_a): Check length before calling memset. From-SVN: r223906
This commit is contained in:
parent
1edfb384e8
commit
5d946f4228
@ -1,3 +1,9 @@
|
||||
2015-05-31 Jonathan Wakely <jwakely@redhat.com>
|
||||
|
||||
PR libstdc++/66354
|
||||
* include/bits/stl_algobase.h (__fill_a): Check length before calling
|
||||
memset.
|
||||
|
||||
2015-05-30 Jonathan Wakely <jwakely@redhat.com>
|
||||
|
||||
* include/bits/stl_algobase.h (__equal<true>::equal): Check length
|
||||
|
@ -705,8 +705,8 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
|
||||
__fill_a(_Tp* __first, _Tp* __last, const _Tp& __c)
|
||||
{
|
||||
const _Tp __tmp = __c;
|
||||
__builtin_memset(__first, static_cast<unsigned char>(__tmp),
|
||||
__last - __first);
|
||||
if (const size_t __len = __last - __first)
|
||||
__builtin_memset(__first, static_cast<unsigned char>(__tmp), __len);
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user