From 9547a28faa9b4a9df02bea3cd55b011d615532e9 Mon Sep 17 00:00:00 2001 From: Mike Gabriel Date: Wed, 15 Apr 2015 12:41:23 +0200 Subject: Add BIGREQUEST extension support to nxproxy/nxcomp. This work has been started by Paul Szarbo but has been discontinued before final completion. So, this is work in progress. For reference / communication history, see [1]. [1] https://bugs.debian.org/766299 --- nxcomp/ServerReadBuffer.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'nxcomp/ServerReadBuffer.cpp') diff --git a/nxcomp/ServerReadBuffer.cpp b/nxcomp/ServerReadBuffer.cpp index 96c146b77..069da2b45 100644 --- a/nxcomp/ServerReadBuffer.cpp +++ b/nxcomp/ServerReadBuffer.cpp @@ -108,14 +108,21 @@ int ServerReadBuffer::locateMessage(const unsigned char *start, { dataLength = 32 + (GetULONG(start + 4, bigEndian_) << 2); } + else if (*start == GenericEvent && *(start+1) != 0) + { + // X Generic Event Extension + dataLength = 32 + (GetULONG(start + 4, bigEndian_) << 2); + } else { dataLength = 32; } - if (dataLength < 32) +// See WRITE_BUFFER_OVERFLOW_SIZE elsewhere +// and also ENCODE_BUFFER_OVERFLOW_SIZE DECODE_BUFFER_OVERFLOW_SIZE. + if (dataLength < 32 || dataLength > 100*1024*1024) { - #ifdef TEST + #ifdef WARNING *logofs << "ServerReadBuffer: WARNING! Assuming length 32 " << "for suspicious message of length " << dataLength << ".\n" << logofs_flush; -- cgit v1.2.3