summaryrefslogtreecommitdiff
path: root/libutils/VectorImpl.cpp
AgeCommit message (Collapse)Author
2018-10-08Move system/core/ off NO_ERROR.Elliott Hughes
It causes trouble for Windows, and OK already exists. Bug: N/A Test: builds Change-Id: Ida22fd658b0ebb259c710ba39049b07c9e495d9c
2018-08-28Move off safe-iop.Elliott Hughes
Bug: http://b/25224572 Test: ran tests Change-Id: I6687015eedb28c69d1f57c9d3cd7324d4995e47a
2018-07-16[libutils] Modernize codebase by replacing NULL with nullptrYi Kong
Fixes -Wzero-as-null-pointer-constant warning. Test: m Bug: 68236239 Change-Id: I5e89ec8c42151875439d2656475a8739ab9cb7dc
2017-03-03clean-up libutils includesMathias Agopian
moved Foo.h as first include of Foo.cpp, and removed redundant includes. Made NativeHandle non virtual. Test: run & compile Bug: n/a Change-Id: I37fa746cd42c9ba23aba181f84cb6c619386406a
2017-01-11liblog: use log/log.h when utilizing ALOG macrosMark Salyzyn
Test: compile Bug: 30465923 Change-Id: Id6d76510819ebd88c3f5003d00d73a0dbe85e943
2016-09-30system/core Replace cutils/log.h with android/log.hMark Salyzyn
Should use android/log.h instead of cutils/log.h as a good example to all others. Adjust header order to comply with Android Coding standards. Test: Compile Bug: 26552300 Bug: 31289077 Change-Id: I2c9cbbbd64d8dccf2d44356361d9742e4a9b9031
2015-09-23am f777655d: resolved conflicts for 6ee734cf to stage-aosp-masterSergio Giro
* commit 'f777655d85af3aefa4a1683f289da1ec67988330': libutils: hide SharedBuffer by moving SharedBuffer.h to the implementation directory
2015-09-23libutils: hide SharedBuffer by moving SharedBuffer.h to the implementation ↵Sergio Giro
directory Some methods in header files of classes using SharedBuffer need to be moved to the implementation files accordingly Change-Id: I891f3ace2b940ab219e4e449040bfed71c0547db
2015-09-08resolved conflicts for 32d86587 to mnc-dr-dev-plus-aospNarayan Kamath
Change-Id: I381133e7dd93f908bd3d2b42e8af83d954e428af
2015-09-02libutils: Fix integer overflows in VectorImpl.Narayan Kamath
Use external/safe-iop to check for overflows on arithmetic operations. Also remove an unnecessary copy of Vector/SharedBuffer from codeflinger and use the copy from libutils instead. Note that some of the unit tests are somewhat useless due to test-runner limitations : gtest's ability to filter on abort message doesn't work when combined with messages formatted by android's logging system. bug: 22953624 Change-Id: I46b1ae8ca1f3a010be13aca36a091e76a97a7b70
2015-08-28VectorImpl.cpp: fix benign multiplication overflowNick Kralevich
j is a ssize_t, which can go negative. If it goes negative, the resulting multiplication of mItemSize*j doesn't make any sense. Since the value is never used, just don't perform the calculation if j < 0. Bug: 23607865 Change-Id: I14f6f6506645d582f7d67a2e2d60ead3cb18b957
2015-08-24libutils: cleanups for -fsanitize=integerNick Kralevich
* Hashing functions rely on integer overflow behavior. Mark those functions as safe. * abort() if a passed in size_t value is greater than UINT32_MAX. This can occur on 64 bit builds where size_t is larger than uint32_t. * Special case the index lookup for an empty sorted vector. Without the special case, size() == 0, and size()-1 underflows. Change-Id: I343a14b589fc8f0d221c1998ae5d6f0b9e2781f8
2013-10-30fix corruption in Vector<> when malloc faliedShuo Gao
1. When alloc or realloc failed in the function SharedBuffer::editResize, it would return a NULL pointer, then mStorage would update to be 1 by SharedBuffer::data() if no pointer check here, which is an obviously wrong address, and would cause corruption when used it e.g. in capacity(). So add the pointer check here for the return value of SharedBuffer::editResize, if it's NULL do not use it to update mStorage, to avoid the value of mStorage polluted. 2. when alloc or realloc falied in _grow & _shrink function, mStorage keep the original value, so mCount should not be updated here. Otherwise, mStorage might be 0 but mCount>0, so a corruption would happend when it try to delete items from the Vector since mCount>0. Change-Id: I7c3814e843c459834ca5eed392e8d63d1cb7d2d8 Signed-off-by: Shuo Gao <shuo.gao@intel.com> Signed-off-by: Jian Luo <jian.luo@intel.com> Signed-off-by: Bruce Beare <bruce.j.beare@intel.com> Signed-off-by: Jack Ren <jack.ren@intel.com> Author-tracking-BZ: 139626
2013-08-02move libs/utils to libutilsAlex Ray
Change-Id: I6cf4268599460791414882f91eeb88a992fbd29d