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

Commit 32130635 authored by Marco Nelissen's avatar Marco Nelissen
Browse files

Add NULL check to CallStack::toString

CallStack::toString() has a 0 default argument, which ends up getting
passed to strlen(), resulting in a crash.

Change-Id: If706aff8c400983670f49cdbb66e11191ac76e0e
parent 0e1e53e3
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -118,7 +118,9 @@ String8 CallStack::toString(const char* prefix) const {
        char line[MAX_BACKTRACE_LINE_LENGTH];
        format_backtrace_line(i, &mStack[i], &symbols[i],
                line, MAX_BACKTRACE_LINE_LENGTH);
        if (prefix) {
            str.append(prefix);
        }
        str.append(line);
        str.append("\n");
    }