Fix negative pointer bug (hopefully)
This commit is contained in:
parent
74c05161b5
commit
a6ba3b309b
1 changed files with 2 additions and 1 deletions
|
@ -52,7 +52,7 @@ void cls()
|
||||||
|
|
||||||
int baseport = 4000;
|
int baseport = 4000;
|
||||||
|
|
||||||
const int BUFLEN = 1024*1024; // in bytes
|
const int BUFLEN = 10240*1024; // in bytes
|
||||||
//const int ABUFLEN = 1024; // in words
|
//const int ABUFLEN = 1024; // in words
|
||||||
|
|
||||||
// Yes this is ugly. :P
|
// Yes this is ugly. :P
|
||||||
|
@ -175,6 +175,7 @@ struct image_sockin : public sockin {
|
||||||
virtual void handle(unsigned char *data, int len, int listener) {
|
virtual void handle(unsigned char *data, int len, int listener) {
|
||||||
int begin = -1, end = -1;
|
int begin = -1, end = -1;
|
||||||
|
|
||||||
|
if (len <= 0) return;
|
||||||
if ((len + bufsize) > IBUFLEN) {
|
if ((len + bufsize) > IBUFLEN) {
|
||||||
bufsize = 0;
|
bufsize = 0;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue