From a6ba3b309b7f5603dd6d009eb4dec6519cfb572b Mon Sep 17 00:00:00 2001 From: Donald Burr Date: Fri, 20 Feb 2015 10:28:44 -0800 Subject: [PATCH] Fix negative pointer bug (hopefully) --- acatcher/acatcher.cxx.template | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/acatcher/acatcher.cxx.template b/acatcher/acatcher.cxx.template index 35268b5..3c4cb50 100644 --- a/acatcher/acatcher.cxx.template +++ b/acatcher/acatcher.cxx.template @@ -52,7 +52,7 @@ void cls() int baseport = 4000; -const int BUFLEN = 1024*1024; // in bytes +const int BUFLEN = 10240*1024; // in bytes //const int ABUFLEN = 1024; // in words // Yes this is ugly. :P @@ -175,6 +175,7 @@ struct image_sockin : public sockin { virtual void handle(unsigned char *data, int len, int listener) { int begin = -1, end = -1; + if (len <= 0) return; if ((len + bufsize) > IBUFLEN) { bufsize = 0; }