OSDN Git Service

Simpleperf: check if elf file paths are valid before reading them.
authorYabin Cui <yabinc@google.com>
Wed, 9 Dec 2015 01:43:15 +0000 (17:43 -0800)
committerYabin Cui <yabinc@google.com>
Wed, 9 Dec 2015 02:36:17 +0000 (18:36 -0800)
commit797116bfb9ad10d858086680c7465d65c399ef6e
tree94c8d884515452948e75d893c89cfc73f5d7c8f9
parent113206fb6548cf95bdb91821c7b4dd384c926756
Simpleperf: check if elf file paths are valid before reading them.

Reading invalid file paths can cause troubles. For example,
reading /dev/zero can eat all memory.

Bug: 25194400
Change-Id: I4de17f4f9200a43b50a4efe4c42a6fd9eaec1ba6
simpleperf/read_elf.cpp
simpleperf/read_elf.h
simpleperf/read_elf_test.cpp
simpleperf/utils.cpp
simpleperf/utils.h