summaryrefslogtreecommitdiffstats
path: root/logd
diff options
context:
space:
mode:
authorAndreas Gampe <agampe@google.com>2017-03-14 20:43:43 -0700
committerAndreas Gampe <agampe@google.com>2017-03-14 20:43:43 -0700
commit34450d70c5ba8efb20df14721507b1bf56e06f82 (patch)
tree664f6b675d7a614773c17bc967bc89c246b97690 /logd
parentfa05eaa9684bf416ea00e1953e8e345416fbad40 (diff)
downloadsystem_core-34450d70c5ba8efb20df14721507b1bf56e06f82.tar.gz
system_core-34450d70c5ba8efb20df14721507b1bf56e06f82.tar.bz2
system_core-34450d70c5ba8efb20df14721507b1bf56e06f82.zip
Logd: Fix wrong parameters
Better keep the right order, or ASAN will complain when you read out of bounds. Bug: 36234128 Test: m Test: m && m SANITIZE_TARGET=address Test: Sanitized device boots without ASAN crashes Change-Id: Ifc09cb0ece6835d2b636a3ad2128e09ca9aa45c9
Diffstat (limited to 'logd')
-rw-r--r--logd/LogKlog.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/logd/LogKlog.cpp b/logd/LogKlog.cpp
index 9ae95f996..9dfa14ed3 100644
--- a/logd/LogKlog.cpp
+++ b/logd/LogKlog.cpp
@@ -754,7 +754,7 @@ int LogKlog::log(const char* buf, size_t len) {
// eg: [143:healthd]healthd -> [143:healthd]
taglen = etag - tag;
// Mediatek-special printk induced stutter
- const char* mp = strnrchr(tag, ']', taglen);
+ const char* mp = strnrchr(tag, taglen, ']');
if (mp && (++mp < etag)) {
size_t s = etag - mp;
if (((s + s) < taglen) && !fastcmp<memcmp>(mp, mp - 1 - s, s)) {