qt: Avoid bogus stringop-overread warning

* lang/qt/src/threadedjobmixin.cpp (_detail::audit_log_as_html): Use
QByteArray overload of QString::fromUtf8.
--

There's no need to make the code more complicated than necessary. Unless
we want to provoke weird compiler warnings. :-)
This commit is contained in:
Ingo Klöcker 2024-05-21 12:36:11 +02:00
parent 333241b286
commit c933269d3a
No known key found for this signature in database
GPG Key ID: F5A5D1692277A1E9

View File

@ -98,8 +98,7 @@ QString _detail::audit_log_as_html(Context *ctx, GpgME::Error &err)
} else if ((err = ctx->getAuditLog(data, CMSAuditLogFlags))) { } else if ((err = ctx->getAuditLog(data, CMSAuditLogFlags))) {
return QString::fromLocal8Bit(err.asString()); return QString::fromLocal8Bit(err.asString());
} }
const QByteArray ba = dp.data(); return QString::fromUtf8(dp.data());
return QString::fromUtf8(ba.data(), ba.size());
} }
return QStringLiteral("Unsupported protocol for Audit Log"); return QStringLiteral("Unsupported protocol for Audit Log");