Socket buffer size fix (#1720)

This commit is contained in:
Sami Vänttinen 2018-04-03 05:13:07 +03:00 committed by Jonathan White
parent 0650b3084e
commit 3a92e4aab9
5 changed files with 24 additions and 5 deletions

View file

@ -20,6 +20,7 @@
#include <QJsonParseError>
#include "BrowserAction.h"
#include "BrowserSettings.h"
#include "NativeMessagingBase.h"
#include "sodium.h"
#include "sodium/crypto_box.h"
#include "sodium/randombytes.h"
@ -456,7 +457,7 @@ QString BrowserAction::encrypt(const QString plaintext, const QString nonce)
std::vector<unsigned char> sk(sa.cbegin(), sa.cend());
std::vector<unsigned char> e;
e.resize(max_length);
e.resize(NATIVE_MSG_MAX_LENGTH);
if (m.empty() || n.empty() || ck.empty() || sk.empty()) {
return QString();
@ -484,7 +485,7 @@ QByteArray BrowserAction::decrypt(const QString encrypted, const QString nonce)
std::vector<unsigned char> sk(sa.cbegin(), sa.cend());
std::vector<unsigned char> d;
d.resize(max_length);
d.resize(NATIVE_MSG_MAX_LENGTH);
if (m.empty() || n.empty() || ck.empty() || sk.empty()) {
return QByteArray();