mirror of
https://github.com/owasp-modsecurity/ModSecurity.git
synced 2025-09-30 03:34:29 +03:00
Makes `large stream optimization' optional
This commit is contained in:
@@ -634,18 +634,25 @@ nextround:
|
||||
free(msr->stream_input_data);
|
||||
msr->stream_input_data = NULL;
|
||||
msr->stream_input_length = 0;
|
||||
#ifdef MSC_LARGE_STREAM_INPUT
|
||||
msr->stream_input_allocated_length = 0;
|
||||
|
||||
msr->stream_input_data = (char *)malloc(size);
|
||||
#else
|
||||
msr->stream_input_data = (char *)malloc(size+1);
|
||||
#endif
|
||||
|
||||
if(msr->stream_input_data == NULL) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
msr->stream_input_length = size;
|
||||
#ifdef MSC_LARGE_STREAM_INPUT
|
||||
msr->stream_input_allocated_length = size;
|
||||
memset(msr->stream_input_data, 0x0, size);
|
||||
|
||||
#else
|
||||
memset(msr->stream_input_data, 0x0, size+1);
|
||||
#endif
|
||||
msr->if_stream_changed = 1;
|
||||
|
||||
memcpy(msr->stream_input_data, data, size);
|
||||
|
Reference in New Issue
Block a user