diff options
author | Christopher Ferris <cferris@google.com> | 2016-05-05 21:19:52 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2016-05-05 21:19:52 +0000 |
commit | dac26a76c313b21b98d2b3d3ddcb6e824a78e233 (patch) | |
tree | b84fa7e8dd7f44832c8885c8e3f67fe79245aad6 /debuggerd | |
parent | a7431cfa570c6385ecd2041d56ead2603d7b7b80 (diff) | |
parent | 039976e553f261c5c43f9bfc295c31b9f6189ffc (diff) |
Merge "Fix null pointer dereference." into nyc-dev
Diffstat (limited to 'debuggerd')
-rw-r--r-- | debuggerd/tombstone.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/debuggerd/tombstone.cpp b/debuggerd/tombstone.cpp index 983d49e17..fa983fa1f 100644 --- a/debuggerd/tombstone.cpp +++ b/debuggerd/tombstone.cpp @@ -201,7 +201,7 @@ static void dump_signal_info(log_t* log, pid_t tid, int signal, int si_code) { static void dump_thread_info(log_t* log, pid_t pid, pid_t tid) { char path[64]; char threadnamebuf[1024]; - char* threadname = NULL; + char* threadname = nullptr; FILE *fp; snprintf(path, sizeof(path), "/proc/%d/comm", tid); @@ -217,13 +217,13 @@ static void dump_thread_info(log_t* log, pid_t pid, pid_t tid) { } // Blacklist logd, logd.reader, logd.writer, logd.auditd, logd.control ... static const char logd[] = "logd"; - if (!strncmp(threadname, logd, sizeof(logd) - 1) + if (threadname != nullptr && !strncmp(threadname, logd, sizeof(logd) - 1) && (!threadname[sizeof(logd) - 1] || (threadname[sizeof(logd) - 1] == '.'))) { log->should_retrieve_logcat = false; } char procnamebuf[1024]; - char* procname = NULL; + char* procname = nullptr; snprintf(path, sizeof(path), "/proc/%d/cmdline", pid); if ((fp = fopen(path, "r"))) { |