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

Commit b47627f0 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

Change-Id: Ie75601a15a58f76cb7ca806355b7f62af470d7c2
parents ea9a0e5f 9b7d7a00
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);
        }
    }
}