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

Commit 9b7d7a00 authored by Dan Austin's avatar Dan Austin Committed by android-build-merger
Browse files

Merge "Fix null pointer dereference in auditParse"

am: 43802150

Change-Id: I955a17f4b3a78e0762f7ae6058555fdea87a1123
parents 098f8a96 43802150
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);
        }
    }
}