Merge "Do not crash if secontext is nullptr"

am: 6418bb7d34

Change-Id: Iad725cb3c6a40a0917106dee3b2b604b1cb921a5
This commit is contained in:
Roman Kiryanov 2018-09-18 07:26:00 -07:00 committed by android-build-merger
commit 95d26139a4

View file

@ -63,7 +63,8 @@ static bool prepare_dir(struct selabel_handle* sehandle, mode_t mode, uid_t uid,
secontext.reset(tmp_secontext);
}
LOG(DEBUG) << "Setting up mode " << std::oct << mode << std::dec << " uid " << uid << " gid "
<< gid << " context " << secontext.get() << " on path: " << path;
<< gid << " context " << (secontext ? secontext.get() : "null")
<< " on path: " << path;
if (secontext) {
if (setfscreatecon(secontext.get()) != 0) {
PLOG(ERROR) << "Unable to read setfscreatecon for: " << path;