The hextileDecodexx functions do not properly check for out-of-bounds writes,
which allows a malicious server to overwrite parts of the stack.
// BPP - 8, 16 or 32
#include <rdr/InStream.h>
+#include <rfb/Exception.h>
#include <rfb/hextileConstants.h>
namespace rfb {
int y = (xy & 15);
int w = ((wh >> 4) & 15) + 1;
int h = (wh & 15) + 1;
+ if (x + w > 16 || y + h > 16) {
+ throw rfb::Exception("HEXTILE_DECODE: Hextile out of bounds");
+ }
PIXEL_T* ptr = buf + y * t.width() + x;
int rowAdd = t.width() - w;
while (h-- > 0) {