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

Commit 43802150 authored by Treehugger Robot's avatar Treehugger Robot Committed by Gerrit Code Review
Browse files

Merge "Fix null pointer dereference in auditParse"

parents 9c4ae20f b43eb943
Loading
Loading
Loading
Loading
+7 −2
Original line number Diff line number Diff line
@@ -165,9 +165,14 @@ void LogAudit::auditParse(const std::string& string, uid_t uid,
        bug_num->assign("");
    }

    // Ensure the uid name is not null before passing it to the bug string.
    if (uid >= AID_APP_START && uid <= AID_APP_END) {
        char* uidname = android::uidToName(uid);
        if (uidname) {
            bug_num->append(" app=");
        bug_num->append(android::uidToName(uid));
            bug_num->append(uidname);
            free(uidname);
        }
    }
}