Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b638126e authored by Narayan Kamath's avatar Narayan Kamath
Browse files

libutils: Fix integer overflows in VectorImpl. DO NOT MERGE

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

(cherry picked from commit c609c31f)

Change-Id: I673b7ab142bed4fcba9159a00a65cf6bca6b1f6c
parent 66b6eb94
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -28,7 +28,7 @@ LOCAL_STATIC_LIBRARIES := libminui libpixelflinger_static libpng
ifeq ($(strip $(BOARD_CHARGER_ENABLE_SUSPEND)),true)
LOCAL_STATIC_LIBRARIES += libsuspend
endif
LOCAL_STATIC_LIBRARIES += libz libstdc++ libcutils liblog libm libc
LOCAL_STATIC_LIBRARIES += libz libstdc++ libcutils liblog libm libc libutils

include $(BUILD_EXECUTABLE)

+2 −2
Original line number Diff line number Diff line
@@ -16,8 +16,6 @@ PIXELFLINGER_SRC_FILES:= \
    codeflinger/blending.cpp \
    codeflinger/texturing.cpp \
    codeflinger/disassem.c \
	codeflinger/tinyutils/SharedBuffer.cpp \
	codeflinger/tinyutils/VectorImpl.cpp \
	fixed.cpp.arm \
	picker.cpp.arm \
	pixelflinger.cpp.arm \
@@ -59,6 +57,8 @@ LOCAL_SHARED_LIBRARIES := libcutils liblog
LOCAL_MODULE:= libpixelflinger
LOCAL_SRC_FILES := $(PIXELFLINGER_SRC_FILES)
LOCAL_CFLAGS := $(PIXELFLINGER_CFLAGS)
LOCAL_C_INCLUDES += external/safe-iop/include
LOCAL_SHARED_LIBRARIES := libcutils liblog libutils

ifneq ($(BUILD_TINY_ANDROID),true)
# Really this should go away entirely or at least not depend on
+2 −2
Original line number Diff line number Diff line
@@ -21,9 +21,9 @@
#include <stdint.h>
#include <sys/types.h>

#include "tinyutils/Vector.h"
#include "tinyutils/KeyedVector.h"
#include "tinyutils/smartpointer.h"
#include "utils/Vector.h"
#include "utils/KeyedVector.h"

#include "ARMAssemblerInterface.h"
#include "CodeCache.h"
+1 −1
Original line number Diff line number Diff line
@@ -23,7 +23,7 @@
#include <pthread.h>
#include <sys/types.h>

#include "tinyutils/KeyedVector.h"
#include "utils/KeyedVector.h"
#include "tinyutils/smartpointer.h"

namespace android {
+2 −2
Original line number Diff line number Diff line
@@ -21,9 +21,9 @@
#include <stdint.h>
#include <sys/types.h>

#include "tinyutils/KeyedVector.h"
#include "tinyutils/Vector.h"
#include "tinyutils/smartpointer.h"
#include "utils/KeyedVector.h"
#include "utils/Vector.h"

#include "ARMAssemblerInterface.h"
#include "CodeCache.h"
Loading