Permalink
Browse files

Disable the "feature" allowing the cgame to read the user's clipboard.

Also remove the non-BUILD_CLIENT version of CL_GetClipboardData
which is never used.
  • Loading branch information...
slipher committed Nov 24, 2018
1 parent b4232b9 commit 672cb005eccaa39a6797794398bb2dde7a7c7864
Showing with 2 additions and 17 deletions.
  1. +2 −6 src/engine/client/cl_cgame.cpp
  2. +0 −9 src/engine/client/cl_main.cpp
  3. +0 −2 src/engine/client/client.h
@@ -1230,12 +1230,8 @@ void CGameVM::QVMSyscall(int index, Util::Reader& reader, IPC::Channel& channel)

case CG_GETCLIPBOARDDATA:
IPC::HandleMsg<GetClipboardDataMsg>(channel, std::move(reader), [this] (int len, std::string& data) {
if (cl_allowPaste->integer) {
std::unique_ptr<char[]> buffer(new char[len]);
buffer[0] = '\0';
CL_GetClipboardData(buffer.get(), len);
data.assign(buffer.get());
}
// TODO(slipher): Remove GetClipboardDataMsg.
data = "";
});
break;

@@ -157,8 +157,6 @@ cvar_t *cl_altTab;
cvar_t *cl_aviMotionJpeg;
// XreaL END

cvar_t *cl_allowPaste;

cvar_t *cl_rate;

cvar_t *cl_cgameSyscallStats;
@@ -3366,8 +3364,6 @@ void CL_Init()
// cgame might not be initialized before menu is used
Cvar_Get( "cg_viewsize", "100", 0 );

cl_allowPaste = Cvar_Get( "cl_allowPaste", "1", 0 );

cl_cgameSyscallStats = Cvar_Get( "cl_cgameSyscallStats", "0", 0 );

//
@@ -4553,9 +4549,4 @@ void CL_GetClipboardData( char *buf, int buflen )

buf[ j ] = '\0';
}
#else
void CL_GetClipboardData( char *buf, int )
{
buf[ 0 ] = '\0';
}
#endif
@@ -494,8 +494,6 @@ extern cvar_t *cl_aviFrameRate;
extern cvar_t *cl_aviMotionJpeg;
// XreaL END

extern cvar_t *cl_allowPaste;

extern cvar_t *cl_useMumble;
extern cvar_t *cl_mumbleScale;

0 comments on commit 672cb00

Please sign in to comment.