mirror of
https://github.com/nsacyber/HIRS.git
synced 2025-01-29 15:44:14 +00:00
The tpm_version tool can sometimes print a null value as part of the TPM major version if the major version is less than 4 characters. These nulls are now removed before printing.
This commit is contained in:
parent
d26a3da5ea
commit
4beb1d2bac
@ -114,6 +114,9 @@ class SapiContext {
|
||||
string reversedStringValue(UINT32 value) {
|
||||
string stringValue(sizeof value, 0);
|
||||
std::memcpy(&stringValue[0], &value, stringValue.size()); // copy bytes in
|
||||
// get rid of all contained null values
|
||||
stringValue.erase(std::remove(stringValue.begin(), stringValue.end(), '\0'),
|
||||
stringValue.end());
|
||||
std::reverse(stringValue.begin(), stringValue.end()); // reverse the bytes
|
||||
return stringValue;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user