mirror of
https://github.com/owasp-modsecurity/ModSecurity.git
synced 2025-09-29 11:16:33 +03:00
Removed useless code
This commit is contained in:
@@ -617,24 +617,15 @@ nextround:
|
||||
size+=sl;
|
||||
*data_out=0;
|
||||
|
||||
if(msr->stream_output_data != NULL && output_body == 1) {
|
||||
|
||||
memset(msr->stream_output_data, 0x0, msr->stream_output_length);
|
||||
if (msr->stream_output_data != NULL && output_body == 1) {
|
||||
free(msr->stream_output_data);
|
||||
msr->stream_output_data = NULL;
|
||||
msr->stream_output_length = 0;
|
||||
|
||||
msr->stream_output_data = (char *)malloc(size+1);
|
||||
|
||||
if(msr->stream_output_data == NULL) {
|
||||
return -1;
|
||||
}
|
||||
if (msr->stream_output_data == NULL) return -1;
|
||||
|
||||
msr->stream_output_length = size;
|
||||
memset(msr->stream_output_data, 0x0, size+1);
|
||||
|
||||
msr->of_stream_changed = 1;
|
||||
|
||||
memcpy(msr->stream_output_data, data, size);
|
||||
msr->stream_output_data[size] = '\0';
|
||||
|
||||
@@ -642,8 +633,7 @@ nextround:
|
||||
var->value = msr->stream_output_data;
|
||||
}
|
||||
|
||||
if(msr->stream_input_data != NULL && input_body == 1) {
|
||||
memset(msr->stream_input_data, 0x0, msr->stream_input_length);
|
||||
if (msr->stream_input_data != NULL && input_body == 1) {
|
||||
free(msr->stream_input_data);
|
||||
msr->stream_input_data = NULL;
|
||||
msr->stream_input_length = 0;
|
||||
@@ -651,9 +641,7 @@ nextround:
|
||||
msr->stream_input_allocated_length = 0;
|
||||
#endif
|
||||
msr->stream_input_data = (char *)malloc(size+1);
|
||||
if(msr->stream_input_data == NULL) {
|
||||
return -1;
|
||||
}
|
||||
if(msr->stream_input_data == NULL) return -1;
|
||||
|
||||
msr->stream_input_length = size;
|
||||
#ifdef MSC_LARGE_STREAM_INPUT
|
||||
@@ -1573,12 +1561,11 @@ static const char *gsb_replace_tpath(apr_pool_t *pool, const char *domain, int l
|
||||
int match = 0;
|
||||
|
||||
url = apr_palloc(pool, len + 1);
|
||||
if (!url) return NULL;
|
||||
data = apr_palloc(pool, len + 1);
|
||||
if (!data) return NULL;
|
||||
|
||||
memset(data, 0, len+1);
|
||||
memset(url, 0, len+1);
|
||||
|
||||
memcpy(url, domain, len);
|
||||
url[len] = 0;
|
||||
|
||||
while(( pos = strstr(url , "/./" )) != NULL) {
|
||||
match = 1;
|
||||
@@ -1589,8 +1576,7 @@ static const char *gsb_replace_tpath(apr_pool_t *pool, const char *domain, int l
|
||||
strncpy(url , data, len);
|
||||
}
|
||||
|
||||
if(match == 0)
|
||||
return domain;
|
||||
if (match == 0) return domain;
|
||||
|
||||
return url;
|
||||
}
|
||||
@@ -1681,8 +1667,6 @@ static int verify_gsb(gsb_db *gsb, modsec_rec *msr, const char *match, unsigned
|
||||
const char *hash = NULL;
|
||||
const char *search = NULL;
|
||||
|
||||
memset(digest, 0, sizeof(digest));
|
||||
|
||||
apr_md5_init(&ctx);
|
||||
|
||||
if ((rc = apr_md5_update(&ctx, match, match_length)) != APR_SUCCESS)
|
||||
@@ -1690,7 +1674,7 @@ static int verify_gsb(gsb_db *gsb, modsec_rec *msr, const char *match, unsigned
|
||||
|
||||
apr_md5_final(digest, &ctx);
|
||||
|
||||
hash = apr_psprintf(msr->mp, "%s", bytes2hex(msr->mp, digest, 16));
|
||||
hash = apr_psprintf(msr->mp, "%s", bytes2hex(msr->mp, digest, APR_MD5_DIGESTSIZE));
|
||||
|
||||
if ((hash != NULL) && (gsb->gsb_table != NULL)) {
|
||||
search = apr_hash_get(gsb->gsb_table, hash, APR_HASH_KEY_STRING);
|
||||
|
Reference in New Issue
Block a user