-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Socket buffer fix #1720
Socket buffer fix #1720
Conversation
f32100e
to
d38a86d
Compare
d38a86d
to
6152a1d
Compare
src/browser/NativeMessagingHost.cpp
Outdated
@@ -142,6 +142,14 @@ void NativeMessagingHost::newLocalConnection() | |||
void NativeMessagingHost::newLocalMessage() | |||
{ | |||
QLocalSocket* socket = qobject_cast<QLocalSocket*>(QObject::sender()); | |||
if (socket) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just put this code after the if (!socket....) check on line 154, no need for additional checks
src/proxy/NativeMessagingHost.cpp
Outdated
@@ -18,10 +18,19 @@ | |||
#include <QCoreApplication> | |||
#include "NativeMessagingHost.h" | |||
|
|||
enum { max_length = 1024*1024 }; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove this once defined in NativeMessagingBase.h
src/browser/BrowserService.h
Outdated
@@ -25,7 +25,7 @@ | |||
#include "gui/DatabaseTabWidget.h" | |||
#include "core/Entry.h" | |||
|
|||
enum { max_length = 16*1024 }; | |||
enum { max_length = 1024*1024 }; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You should define this in NativeMessagingBase.h since it is shared between the proxy and browser code. Also, define as a constant: static const int NATIVE_MSG_MAX_LENGTH = 1024*1024;
with all caps being the standard convention
d666625
to
e7ffd61
Compare
317f543
to
786d006
Compare
We may want to add a test that passes a very large message. |
Hi all, this patch break windows compilation : |
- Enable high entropy ASLR on Windows [#1747] - Enhance favicon fetching [#1786] - Fix crash on Windows due to autotype [#1691] - Fix dark tray icon changing all icons [#1680] - Fix --pw-stdin not using getPassword function [#1686] - Fix placeholders being resolved in notes [#1907] - Enable auto-type start delay to be configurable [#1908] - Browser: Fix native messaging reply size [#1719] - Browser: Increase maximum buffer size [#1720] - Browser: Enhance usability and functionality [#1810, #1822, #1830, #1884, #1906] - SSH Agent: Parse aes-256-cbc/ctr keys [#1682] - SSH Agent: Enhance usability and functionality [#1677, #1679, #1681, #1787]
Increases the maximum buffer size of keepassxc-protocol and Unix Sockets to 1M. This is the maximum messaging size for a single message with native messaging.
Motivation and context
Solves issues where the message size goes over the maximum default of Unix Socket buffer 8k bytes.
How has this been tested?
Manually.
Types of changes
Checklist:
-DWITH_ASAN=ON
. [REQUIRED]