Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(828)

Unified Diff: remoting/host/gnubby_socket.cc

Issue 216693005: Fix memory overwrite when sending error code on socket (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/host/gnubby_socket.cc
diff --git a/remoting/host/gnubby_socket.cc b/remoting/host/gnubby_socket.cc
index 09d5d301825f9a9b24699de230fd349e2f4be525..40cb7d42a63b72d1eb0a3bd551f29b25690bc87e 100644
--- a/remoting/host/gnubby_socket.cc
+++ b/remoting/host/gnubby_socket.cc
@@ -4,6 +4,7 @@
#include "remoting/host/gnubby_socket.h"
+#include "base/macros.h"
#include "base/timer/timer.h"
#include "net/socket/stream_listen_socket.h"
@@ -75,7 +76,7 @@ void GnubbySocket::SendResponse(const std::string& response_data) {
void GnubbySocket::SendSshError() {
DCHECK(CalledOnValidThread());
- SendResponse(kSshError);
+ SendResponse(std::string(kSshError, arraysize(kSshError)));
}
bool GnubbySocket::IsSocket(net::StreamListenSocket* socket) const {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698