Merge "Trim trailing zeros from build information." into vic-widevine-dev
This commit is contained in:
@@ -2541,6 +2541,17 @@ bool CryptoSession::GetBuildInformation(RequestedSecurityLevel security_level,
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
info->resize(info_length);
|
info->resize(info_length);
|
||||||
|
// Some OEMCrypto implementations may include trailing null
|
||||||
|
// bytes in the output. Trim them here.
|
||||||
|
while (!info->empty() && info->back() == '\0') {
|
||||||
|
info->pop_back();
|
||||||
|
}
|
||||||
|
if (info->empty()) {
|
||||||
|
LOGE("BuildInformation() returned corrupted data: length = %zu",
|
||||||
|
info_length);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user