fix: Prevent out-of-bounds access for Qt string when building TLS fingerprint
Only happens when using debug build of Qt lib because release Qt is optimized and doesn't check for bounds for the sake of efficiency.
This commit is contained in:
parent
477c7b07e5
commit
39382bfd8c
1 changed files with 3 additions and 2 deletions
|
|
@ -157,8 +157,9 @@ QString formatSSLFingerprintColumns(const QByteArray &fingerprint)
|
|||
|
||||
QString formattedString;
|
||||
while (!hex.isEmpty()) {
|
||||
formattedString.append(hex.first(kMaxColumns));
|
||||
hex.remove(0, kMaxColumns);
|
||||
const auto take = std::min<size_t>(kMaxColumns, hex.size());
|
||||
formattedString.append(hex.first(take));
|
||||
hex.remove(0, take);
|
||||
if (formattedString.endsWith(':'))
|
||||
formattedString.removeLast();
|
||||
formattedString.append('\n');
|
||||
|
|
|
|||
Loading…
Reference in a new issue