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

Commit 7b6b8c41 authored by Dan Austin's avatar Dan Austin Committed by android-build-merger
Browse files

Merge "Fix null pointer dereference in auditParse" am: 43802150 am: 9b7d7a00

am: b47627f0

Change-Id: Ib1d1aaf251d17f3fbf849d7ee751b5bfe01a7cbd
parents 5570f98a b47627f0
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);
        }
    }
}