Skip to content
Browse files

Merge "Fix null pointer dereference."

  • Loading branch information...
2 parents d494665 + 157f272 commit 830561bb2b34ca8c09be4860380e9032202c3112 Treehugger Robot committed with Gerrit Code Review May 5, 2016
Showing with 3 additions and 3 deletions.
  1. +3 −3 debuggerd/tombstone.cpp
View
6 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"))) {

0 comments on commit 830561b

Please sign in to comment.
Something went wrong with that request. Please try again.