Go to file
Shuo Gao 0a885309aa fix corruption in Vector<> when malloc falied
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-10-22 22:36:46 -07:00
build Add Dalvik heap definition for 7" xhdpi devices. 2013-05-06 15:06:20 -07:00
cmds Proper security labeling of multi-user data directories. 2013-09-18 13:21:12 +00:00
data/etc Add hardware feature android.hardware.bluetooth.le xml file 2013-04-23 11:58:44 -07:00
include Remove copy of UniquePtr.h 2013-09-11 14:29:20 -07:00
libs fix corruption in Vector<> when malloc falied 2013-10-22 22:36:46 -07:00
opengl Fix OpenGL stub exception handling. 2013-09-24 17:18:05 -07:00
services fix a possible deadlock when removing a layer and destroying a client 2013-08-05 14:28:46 -07:00
MODULE_LICENSE_APACHE2
NOTICE