mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2025-08-01 02:56:21 -04:00
Fix wrong reply size in NativeMessagingBase
* Using length() on QString won't return correct size in bytes when string contains UTF-8 chars.
This commit is contained in:
parent
970cedf972
commit
3353b329fc
1 changed files with 2 additions and 1 deletions
|
@ -121,7 +121,8 @@ void NativeMessagingBase::sendReply(const QJsonObject& json)
|
||||||
void NativeMessagingBase::sendReply(const QString& reply)
|
void NativeMessagingBase::sendReply(const QString& reply)
|
||||||
{
|
{
|
||||||
if (!reply.isEmpty()) {
|
if (!reply.isEmpty()) {
|
||||||
uint len = reply.length();
|
QByteArray bytes = reply.toUtf8();
|
||||||
|
uint len = bytes.size();
|
||||||
std::cout << char(((len>>0) & 0xFF)) << char(((len>>8) & 0xFF)) << char(((len>>16) & 0xFF)) << char(((len>>24) & 0xFF));
|
std::cout << char(((len>>0) & 0xFF)) << char(((len>>8) & 0xFF)) << char(((len>>16) & 0xFF)) << char(((len>>24) & 0xFF));
|
||||||
std::cout << reply.toStdString() << std::flush;
|
std::cout << reply.toStdString() << std::flush;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue