fixed DoS attack using z compressed WML on server

This commit is contained in:
David White 2009-02-24 03:22:49 +00:00
parent fd5c54fbb3
commit db334d32e1

View file

@ -28,6 +28,10 @@ char* uncompress_buffer(const string_span& input, string_span* span)
int len = 0;
int pos = 0;
while(filter.good() && (len = filter.read(&buf[pos], chunk_size).gcount()) == chunk_size) {
if(pos + chunk_size > 40000000) {
throw error("WML document exceeds 40MB limit");
}
pos += len;
buf.resize(pos + chunk_size);
len = 0;